def train_evaluate(agent_params, num_train=100, num_eval=100): """ Run num_train training trials and num_eval evaluation trials for a LearningAgent initialized with a single set of agent_params. Returns a TrainEvalPerformance that captures performances and agent info. """ sim, e = initialize_simulator_environment(agent_params) training_perfs = sim.run(num_train) e.primary_agent.stop_learning() evaluation_perfs = sim.run(num_eval) print agent_info = e.primary_agent.agent_info return TrainEvalPerformance(training_perfs, evaluation_perfs, agent_info)
def test_six_agentstates_total(self): sim, e = initialize_simulator_environment() agentstates = list(e.primary_agent.generate_all_agentstates()) self.assertEqual(len(agentstates), 6)