Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions axelrod/tests/integration/test_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ def test_noisy_tournament(self):
# Defector should win for low noise
players = [axelrod.Cooperator(), axelrod.Defector()]
tournament = axelrod.Tournament(players, turns=20, repetitions=10,
with_morality=False, noise=0.)
noise=0.)
results = tournament.play(progress_bar=False)
self.assertEqual(results.ranked_names[0], "Defector")

# If the noise is large enough, cooperator should win
players = [axelrod.Cooperator(), axelrod.Defector()]
tournament = axelrod.Tournament(players, turns=20, repetitions=10,
with_morality=False, noise=0.75)
noise=0.75)
results = tournament.play(progress_bar=False)
self.assertEqual(results.ranked_names[0], "Cooperator")

Expand Down
4 changes: 0 additions & 4 deletions axelrod/tests/unit/test_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def test_init(self):
self.assertEqual(tournament.turns, self.test_turns)
self.assertEqual(tournament.repetitions, 10)
self.assertEqual(tournament.name, 'test')
self.assertTrue(tournament._with_morality)
self.assertIsInstance(tournament._logger, logging.Logger)
self.assertEqual(tournament.noise, 0.2)
anonymous_tournament = axelrod.Tournament(players=self.players)
Expand Down Expand Up @@ -564,7 +563,6 @@ def test_init(self):
self.assertIsNone(tournament.turns)
self.assertEqual(tournament.repetitions, 10)
self.assertEqual(tournament.name, 'test')
self.assertTrue(tournament._with_morality)
self.assertIsInstance(tournament._logger, logging.Logger)
self.assertEqual(tournament.noise, 0.2)
anonymous_tournament = axelrod.Tournament(players=self.players)
Expand Down Expand Up @@ -624,7 +622,6 @@ def test_init(self):
self.assertEqual(tournament.turns, 100)
self.assertEqual(tournament.repetitions, 10)
self.assertEqual(tournament.name, 'test')
self.assertTrue(tournament._with_morality)
self.assertIsInstance(tournament._logger, logging.Logger)
self.assertEqual(tournament.noise, 0.2)
self.assertEqual(tournament.match_generator.noise, 0.2)
Expand Down Expand Up @@ -729,7 +726,6 @@ def test_init(self):
self.assertIsNone(tournament.turns)
self.assertEqual(tournament.repetitions, 10)
self.assertEqual(tournament.name, 'test')
self.assertTrue(tournament._with_morality)
self.assertIsInstance(tournament._logger, logging.Logger)
self.assertEqual(tournament.noise, 0.2)
self.assertEqual(tournament.match_generator.noise, 0.2)
Expand Down
6 changes: 1 addition & 5 deletions axelrod/tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Tournament(object):
def __init__(self, players: List[Player],
name: str = 'axelrod', game: Game = None, turns: int = None,
prob_end: float = None, repetitions: int = 10,
noise: float = 0, with_morality: bool = True,
edges: List[Tuple] = None) -> None:
noise: float = 0, edges: List[Tuple] = None) -> None:
"""
Parameters
----------
Expand All @@ -41,8 +40,6 @@ def __init__(self, players: List[Player],
The number of times the round robin should be repeated
noise : float
The probability that a player's intended action should be flipped
with_morality : boolean
Whether morality metrics should be calculated
prob_end : float
The probability of a given turn ending a match
edges : list
Expand Down Expand Up @@ -70,7 +67,6 @@ def __init__(self, players: List[Player],
prob_end=prob_end,
noise=self.noise,
edges=edges)
self._with_morality = with_morality
self._logger = logging.getLogger(__name__)

def setup_output(self, filename=None, in_memory=False):
Expand Down