Exemplo n.º 1
0
 def test_init_single(self):
     """Define the arena with one version"""
     arena = Arena([
         ("Random", lambda seed: AgentRandom(seed))
     ], 5)
     results = arena.results()
     self.assertEqual(len(results), 1)
     self.assertListEqual(results, [("Random", "Random", 1)])
Exemplo n.º 2
0
 def test_init_multiple(self):
     """Define the arena with several agents"""
     arena = Arena([("Random A", lambda seed: AgentRandom(seed)),
                    ("Random C", lambda seed: AgentRandom(seed)),
                    ("Random B", lambda seed: AgentRandom(seed))], 5)
     results = arena.results()
     self.assertEqual(len(results), 6)
     self.assertListEqual(results, [('Random A', 'Random A', 1),
                                    ('Random A', 'Random B', 1),
                                    ('Random A', 'Random C', 1),
                                    ('Random B', 'Random B', 1),
                                    ('Random C', 'Random B', 1),
                                    ('Random C', 'Random C', 1)])