main :: IO ()
main = withSocketsDo $ do
  logH <- fileHandler "Master.log" INFO >>= \lh -> return $
          setFormatter lh (simpleLogFormatter "[$time : $prio] $msg")
  updateGlobalLogger rootLoggerName (addHandler logH)
  (num,p0) <- loadMaxPopulation
  let genomes = concatMap (\(_,_,_,_,gs) -> gs) p0
  let gInnov = maximum . map _innovation . concatMap _genes $ genomes
  let gen = randomRs (0.0,1.0) $ mkStdGen 23
  sock <- socket AF_INET Stream 0
  setSocketOption sock ReuseAddr 1
  bindSocket sock (SockAddrInet 3000 iNADDR_ANY)
  listen sock 5
  infoM rootLoggerName "Listening on port 3000"
  runPopulation (gInnov,p0,gen) num sock
main :: IO ()
main = withSocketsDo $ do
  logH <- fileHandler "Master.log" INFO >>= \lh -> return $
          setFormatter lh (simpleLogFormatter "[$time : $prio] $msg")
  updateGlobalLogger rootLoggerName (addHandler logH)
  (num,p0) <- loadMaxPopulation
  let genomes = concatMap (\(_,_,_,_,gs) -> gs) p0
  let gInnov = maximum . map _innovation . concatMap _genes $ genomes
  let gen = randomRs (0.0,1.0) $ mkStdGen 23
  sock <- socket AF_INET Stream 0
  setSocketOption sock ReuseAddr 1
  bindSocket sock (SockAddrInet 3000 iNADDR_ANY)
  listen sock 5
  infoM rootLoggerName "Listening on port 3000"
  runPopulation (gInnov,p0,gen) num sock
main = withSocketsDo $ do
  logH <- fileHandler "Master.log" INFO >>= \lh -> return $
          setFormatter lh (simpleLogFormatter "[$time : $prio] $msg")
  updateGlobalLogger rootLoggerName (addHandler logH)
  (num,p0) <- loadMaxPopulation
  let genomes = concatMap (\(_,_,_,_,gs) -> gs) p0
  let gInnov = maximum . map _innovation . concatMap _genes $ genomes
  let gen = randomRs (0.0,1.0) $ mkStdGen 23
  sock <- socket AF_INET Stream 0
  setSocketOption sock ReuseAddr 1
  bindSocket sock (SockAddrInet 3000 iNADDR_ANY)
  listen sock 5
  infoM rootLoggerName "Listening on port 3000"
  runPopulation (gInnov,p0,gen) num sock