def tscizzle_strategies(): """The list of strategies used in @tscizzle's Morality Metrics paper.""" strategies = [ axelrod.Cooperator(), axelrod.Defector(), axelrod.Eatherley(), axelrod.Champion(), axelrod.GTFT(p=0.1), axelrod.GTFT(p=0.3), axelrod.GoByMajority(soft=True), axelrod.GoByMajority(soft=False), axelrod.TitFor2Tats(), axelrod.Random(0.8), axelrod.Random(0.5), axelrod.Random(0.2), axelrod.WinStayLoseShift(), # Pavlov axelrod.TitForTat(), axelrod.TwoTitsForTat(), axelrod.Grudger(), # Friedman axelrod.Tester(), axelrod.SuspiciousTitForTat(), axelrod.Joss(0.9), axelrod.Joss(0.7), ] return strategies
def sp_strategies(): """The list of strategies used in Stewart and Plotkin's 2012 tournament.""" strategies = [ axelrod.Cooperator(), # ALLC axelrod.Defector(), # ALLD axelrod.GTFT(), axelrod.GoByMajority(soft=False), # HARD_MAJO #axelrod.GoByMajority(soft=True), # SOFT_MAJO axelrod.TitFor2Tats(), # TFT2 axelrod.HardTitFor2Tats(), # HARD_TFT2 axelrod.Random(), # RANDOM axelrod.WinStayLoseShift(), # WSLS axelrod.TitForTat(), axelrod.HardTitForTat(), # HARD_TFT axelrod.Grudger(), # GRIM axelrod.Joss(), # HARD_JOSS axelrod.ZDGTFT2(), axelrod.ZDExtort2(), axelrod.Prober(), axelrod.Prober2(), axelrod.Prober3(), axelrod.HardProber(), axelrod.Calculator(), ] return strategies
def test_multiple_instances(self): """Certain instances of classes of strategies will have different classifiers based on the initialisation variables""" P1 = axelrod.MemoryOnePlayer((.5, .5, .5, .5)) P2 = axelrod.MemoryOnePlayer((1, 0, 0, 1)) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axelrod.Joss() P2 = axelrod.Joss(0) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axelrod.GTFT(1) P2 = axelrod.GTFT(.5) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axelrod.StochasticWSLS() P2 = axelrod.StochasticWSLS(0) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axelrod.GoByMajority(5) P2 = axelrod.StochasticWSLS(.1) self.assertNotEqual(P1.classifier, P2.classifier)
def test_multiple_instances(self): """Certain instances of classes of strategies will have different classifiers based on the initialisation variables""" P1 = axl.MemoryOnePlayer(four_vector=(.5, .5, .5, .5)) P2 = axl.MemoryOnePlayer(four_vector=(1, 0, 0, 1)) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axl.Joss() P2 = axl.Joss(p=0) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axl.GTFT(p=1) P2 = axl.GTFT(p=.5) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axl.StochasticWSLS() P2 = axl.StochasticWSLS(ep=0) self.assertNotEqual(P1.classifier, P2.classifier) P1 = axl.GoByMajority(memory_depth=5) P2 = axl.StochasticWSLS(ep=.1) self.assertNotEqual(P1.classifier, P2.classifier)
plt.close() # The list of agents playing in the Axelrod's first tournament, except Graaskamp axl_first_players = [ axl.TitForTat(), axl.TidemanAndChieruzzi(), axl.Nydegger(), axl.Grofman(), axl.Shubik(), axl.SteinAndRapoport(), axl.Grudger(), axl.Davis(), axl.RevisedDowning(), axl.Feld(), axl.Joss(), axl.Tullock(), axl.UnnamedStrategy(), axl.Random() ] # The list of agents playing in the Axelrod's second tournament. Incomplete axl_second_players = [ axl.Black(), axl.Borufsen(), axl.Cave(), axl.Champion(), axl.Colbert(), axl.Eatherley(), axl.Getzler(), axl.Gladstein(),