예제 #1
0
    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))
예제 #2
0
 def test_vs(self):
     self.versus_test(axelrod.PSOGambler(), axelrod.Alternator(),
                      [C, C, D, D, D, D], [C, D, C, D, C, D])
예제 #3
0
 def test_vs(self):
     self.versus_test(axelrod.PSOGambler(), axelrod.TitForTat(),
                      [C, C, C, C], [C, C, C, C])
예제 #4
0
 def test_vs(self):
     self.versus_test(axelrod.PSOGambler(), axelrod.Cooperator(),
                      [C, C, C, C], [C, C, C, C])
예제 #5
0
 def test_vs(self):
     self.versus_test(axelrod.PSOGambler(), axelrod.Defector(),
                      [C, C, D, D], [D, D, D, D])
예제 #6
0
 def test_vs(self):
     outcomes = zip()
     self.versus_test(axelrod.PSOGambler(), axelrod.TitForTat(),
                      [C, C, C, C], [C, C, C, C])