def test_parallel_play(self): # Test that we get an instance of ResultSet tournament = axelrod.Tournament(name=self.test_name, players=self.players, game=self.game, turns=200, repetitions=self.test_repetitions) results = tournament.play(processes=2, progress_bar=False) self.assertIsInstance(results, axelrod.ResultSet) self.assertEqual(tournament.num_interactions, 75) # The following relates to #516 players = [ axelrod.Cooperator(), axelrod.Defector(), axelrod.BackStabber(), axelrod.PSOGambler(), axelrod.ThueMorse(), axelrod.DoubleCrosser() ] tournament = axelrod.Tournament(name=self.test_name, players=players, game=self.game, turns=20, repetitions=self.test_repetitions) scores = tournament.play(processes=2, progress_bar=False).scores self.assertEqual(len(scores), len(players))
def test_vs(self): self.versus_test(axelrod.PSOGambler(), axelrod.Alternator(), [C, C, D, D, D, D], [C, D, C, D, C, D])
def test_vs(self): self.versus_test(axelrod.PSOGambler(), axelrod.TitForTat(), [C, C, C, C], [C, C, C, C])
def test_vs(self): self.versus_test(axelrod.PSOGambler(), axelrod.Cooperator(), [C, C, C, C], [C, C, C, C])
def test_vs(self): self.versus_test(axelrod.PSOGambler(), axelrod.Defector(), [C, C, D, D], [D, D, D, D])
def test_vs(self): outcomes = zip() self.versus_test(axelrod.PSOGambler(), axelrod.TitForTat(), [C, C, C, C], [C, C, C, C])