def test_tft_reacts_to_defection(self): tft = axelrod.TitForTat() inspector = axelrod.Alternator() simulate_match(inspector, tft, D, 5) self.assertEqual(inspector.history, [D, D, D, D, D]) self.assertEqual(tft.history, [C, D, D, D, D])
def test_tft_reacts_to_cooperation(self): tft = axl.TitForTat() inspector = axl.Alternator() simulate_match(inspector, tft, C, 5) self.assertEqual(inspector.history, [C, C, C, C, C]) self.assertEqual(tft.history, [C, C, C, C, C])
def test_tft_reacts_to_defection(self): tft = axelrod.TitForTat() inspector = axelrod.Alternator() simulate_match(inspector, tft, D, 5) self.assertEqual(inspector.history, [D, D, D, D, D]) self.assertEqual(tft.history, [C, D, D, D, D])
def test_simulate_matches(self): """ Simulates a number of matches """ p1 = axelrod.MindReader() p2 = axelrod.Grudger() simulate_match(p1, p2, C, 4) self.assertEqual(p2.history, [C, C, C, C])
def test_simulate_matches(self): """ Simulates a number of matches """ P1 = axelrod.MindReader() P2 = axelrod.Grudger() simulate_match(P1, P2, C, 4) self.assertEqual(P2.history, [C, C, C, C])
def test_simulate_matches(self): """ Simulates a number of matches """ P1 = axelrod.MindReader() P2 = axelrod.Grudger() simulate_match(P1, P2, C, 4) self.assertEqual(P2.history, [C, C, C, C])