ntroduceRandomAgent
  :: String -> StateT (Universe PatternWain) IO [Statistic]
introduceRandomAgent name = do
  u <- get
  classifierSize
    <- liftIO . evalRandIO . getRandomR . view uClassifierSizeRange $ u
  predictorSize
    <- liftIO . evalRandIO . getRandomR . view uPredictorSizeRange $ u
  agent
    <- liftIO . evalRandIO $
        randomPatternWain name u classifierSize predictorSize
  -- Make the first generation a little hungry so they start learning
  -- immediately.
  let (agent', _) = adjustEnergy 0.8 agent
  writeToLog $ "GeneratePopulation: Created " ++ agentId agent'
  writeToLog $ "GeneratePopulation: Stats " ++ pretty (stats agent')
  store agent'
  return (stats agent')

introduceRandomAgent
  :: String -> StateT (Universe PatternWain) IO [Statistic]
introduceRandomAgent name = do
  u <- get
  classifierSize
    <- liftIO . evalRandIO . getRandomR . view uClassifierSizeRange $ u
  predictorSize
    <- liftIO . evalRandIO . getRandomR . view uPredictorSizeRange $ u
  agent
    <- liftIO . evalRandIO $
        randomPatternWain name u classifierSize predictorSize
  -- Make the first generation a little hungry so they start learning
  -- immediately.
  let (agent', _) = adjustEnergy 0.8 agent
  writeToLog $ "GeneratePopulation: Created " ++ agentId agent'
  writeToLog $ "GeneratePopulation: Stats " ++ pretty (stats agent')
  store agent'
  return (stats agent')
introduceRandomAgent name = do
  u <- get
  classifierSize
    <- liftIO . evalRandIO . getRandomR . view uClassifierSizeRange $ u
  predictorSize
    <- liftIO . evalRandIO . getRandomR . view uPredictorSizeRange $ u
  agent
    <- liftIO . evalRandIO $
        randomPatternWain name u classifierSize predictorSize
  -- Make the first generation a little hungry so they start learning
  -- immediately.
  let (agent', _) = adjustEnergy 0.8 agent
  writeToLog $ "GeneratePopulation: Created " ++ agentId agent'
  writeToLog $ "GeneratePopulation: Stats " ++ pretty (stats agent')
  store agent'
  return (stats agent')