diff --git a/axelrod/player.py b/axelrod/player.py index 49b08e4f2..1ae55b799 100644 --- a/axelrod/player.py +++ b/axelrod/player.py @@ -8,6 +8,17 @@ # Strategy classifiers +def is_basic(s): + """ + Defines criteria for a strategy to be considered 'basic' + """ + stochastic = s.classifier['stochastic'] + depth = s.classifier['memory_depth'] + inspects_source = s.classifier['inspects_source'] + manipulates_source = s.classifier['manipulates_source'] + manipulates_state = s.classifier['manipulates_state'] + return (not stochastic) and (not inspects_source) and (not manipulates_source) and (not manipulates_state) and (depth in (0, 1)) + def is_cheater(s): """ A function to check if a strategy cheats. diff --git a/axelrod/strategies/__init__.py b/axelrod/strategies/__init__.py index 6deedaf05..c163843b9 100644 --- a/axelrod/strategies/__init__.py +++ b/axelrod/strategies/__init__.py @@ -1,4 +1,4 @@ -from ..player import is_cheater +from ..player import is_basic, is_cheater from ._strategies import * # `from ._strategies import *` import the collection `strategies` @@ -11,8 +11,7 @@ # Distinguished strategy collections in addition to # `strategies` from _strategies.py +demo_strategies = [Cooperator, Defector, TitForTat, Grudger, Random] +basic_strategies = [s for s in strategies if is_basic(s())] ordinary_strategies = [s for s in strategies if not is_cheater(s())] cheating_strategies = [s for s in strategies if is_cheater(s())] - -# Defined by fiat for demo purposes -basic_strategies = [Alternator, Cooperator, Defector, Random, TitForTat] diff --git a/axelrod/strategies/_strategies.py b/axelrod/strategies/_strategies.py index e9409e788..5c9c3626d 100644 --- a/axelrod/strategies/_strategies.py +++ b/axelrod/strategies/_strategies.py @@ -41,8 +41,7 @@ SuspiciousTitForTat, AntiTitForTat, HardTitForTat, HardTitFor2Tats) -# Note: Meta* strategies are handled in .__init__.py, so this is not the -# final form of the list +# Note: Meta* strategies are handled in .__init__.py strategies = [ Aggravater, diff --git a/axelrod/tests/unit/test_classification.py b/axelrod/tests/unit/test_classification.py index b6c7baec3..9bdfb6d2d 100644 --- a/axelrod/tests/unit/test_classification.py +++ b/axelrod/tests/unit/test_classification.py @@ -62,6 +62,16 @@ def test_is_cheater(self): axelrod.MindWarper, axelrod.MindReader] + known_basic = [axelrod.Alternator, + axelrod.AntiTitForTat, + axelrod.Bully, + axelrod.Cooperator, + axelrod.Defector, + axelrod.GoByMajority, + axelrod.SuspiciousTitForTat, + axelrod.TitForTat, + axelrod.WinStayLoseShift] + known_ordinary = [axelrod.AverageCopier, axelrod.ForgivingTitForTat, axelrod.GoByMajority20, @@ -72,26 +82,42 @@ def test_is_cheater(self): for strategy in known_cheaters: self.assertTrue(axelrod.is_cheater(strategy()), msg=strategy) + self.assertFalse(axelrod.is_basic(strategy()), msg=strategy) + + for strategy in known_basic: + self.assertTrue(axelrod.is_basic(strategy()), msg=strategy) + self.assertFalse(axelrod.is_cheater(strategy()), msg=strategy) for strategy in known_ordinary: + self.assertFalse(axelrod.is_basic(strategy()), msg=strategy) self.assertFalse(axelrod.is_cheater(strategy()), msg=strategy) class TestStrategies(unittest.TestCase): def test_strategy_list(self): - self.assertTrue(hasattr(axelrod, "strategies")) - self.assertTrue(hasattr(axelrod, "basic_strategies")) - self.assertTrue(hasattr(axelrod, "ordinary_strategies")) - self.assertTrue(hasattr(axelrod, "cheating_strategies")) + for strategy_list in ["strategies", + "demo_strategies", + "basic_strategies", + "ordinary_strategies", + "cheating_strategies"]: + self.assertTrue(hasattr(axelrod, strategy_list)) def test_lists_not_empty(self): - self.assertTrue(len(axelrod.strategies) > 0) - self.assertTrue(len(axelrod.basic_strategies) > 0) - self.assertTrue(len(axelrod.ordinary_strategies) > 0) - self.assertTrue(len(axelrod.cheating_strategies) > 0) + for strategy_list in [axelrod.strategies, + axelrod.demo_strategies, + axelrod.basic_strategies, + axelrod.ordinary_strategies, + axelrod.cheating_strategies]: + self.assertTrue(len(strategy_list) > 0) def test_meta_inclusion(self): self.assertTrue(axelrod.MetaMajority in axelrod.strategies) - + def test_demo_strategies(self): + demo_strategies = [axelrod.Cooperator, + axelrod.Defector, + axelrod.TitForTat, + axelrod.Grudger, + axelrod.Random] + self.assertTrue(demo_strategies, axelrod.demo_strategies) diff --git a/docs/_static/usage/basic_strategies-5-Defector-3-TitForTat.svg b/docs/_static/usage/demo_strategies-5-Defector-3-TitForTat.svg similarity index 100% rename from docs/_static/usage/basic_strategies-5-Defector-3-TitForTat.svg rename to docs/_static/usage/demo_strategies-5-Defector-3-TitForTat.svg diff --git a/docs/_static/usage/basic_strategies-reproduce-huge-initial-D.svg b/docs/_static/usage/demo_strategies-reproduce-huge-initial-D.svg similarity index 100% rename from docs/_static/usage/basic_strategies-reproduce-huge-initial-D.svg rename to docs/_static/usage/demo_strategies-reproduce-huge-initial-D.svg diff --git a/docs/_static/usage/basic_strategies-reproduce-large-initial-D.svg b/docs/_static/usage/demo_strategies-reproduce-large-initial-D.svg similarity index 100% rename from docs/_static/usage/basic_strategies-reproduce-large-initial-D.svg rename to docs/_static/usage/demo_strategies-reproduce-large-initial-D.svg diff --git a/docs/_static/usage/basic_strategies_20_turns_50_repetitions.svg b/docs/_static/usage/demo_strategies_20_turns_50_repetitions.svg similarity index 100% rename from docs/_static/usage/basic_strategies_20_turns_50_repetitions.svg rename to docs/_static/usage/demo_strategies_20_turns_50_repetitions.svg diff --git a/docs/_static/usage/demo_strategies_boxplot.svg b/docs/_static/usage/demo_strategies_boxplot.svg new file mode 100644 index 000000000..3b2d4a97b --- /dev/null +++ b/docs/_static/usage/demo_strategies_boxplot.svg @@ -0,0 +1,1478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/usage/demo_strategies_payoff.svg b/docs/_static/usage/demo_strategies_payoff.svg new file mode 100644 index 000000000..d564794c8 --- /dev/null +++ b/docs/_static/usage/demo_strategies_payoff.svg @@ -0,0 +1,3454 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/usage/demo_strategies_reproduce.svg b/docs/_static/usage/demo_strategies_reproduce.svg new file mode 100644 index 000000000..9286df2fd --- /dev/null +++ b/docs/_static/usage/demo_strategies_reproduce.svg @@ -0,0 +1,2293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_static/usage/basic_strategies_scaled_games.svg b/docs/_static/usage/demo_strategies_scaled_games.svg similarity index 100% rename from docs/_static/usage/basic_strategies_scaled_games.svg rename to docs/_static/usage/demo_strategies_scaled_games.svg diff --git a/docs/usage.rst b/docs/usage.rst index a34f12a9f..97c429cd1 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -17,7 +17,7 @@ repository:: pip install axelrod -Take a look at this asciicast which demonstrates how to do this (and run a basic +Take a look at this asciicast which demonstrates how to do this (and run a demo tournament): .. image:: https://asciinema.org/a/18590.png @@ -42,10 +42,10 @@ Using as a library Creating and running a tournament ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -We can list the so called 'basic strategies' by doing the following:: +We can list the so called 'demo strategies' by doing the following:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] for s in strategies: print s @@ -54,14 +54,14 @@ which gives:: Alternator Cooperator Defector - Random: 0.5 + Random Tit For Tat Before creating a tournament let us add another :code:`Defector` to our strategies:: strategies.append(axelrod.Defector()) -We can easily create a tournament with these basic strategies by doing the following:: +We can easily create a tournament with these demo strategies by doing the following:: tournament = axelrod.Tournament(strategies) @@ -71,7 +71,7 @@ To view the player types in our tournament:: which gives:: - [Alternator, Cooperator, Defector, Random: 0.5, Tit For Tat, Defector] + [Alternator, Cooperator, Defector, Random, Tit For Tat, Defector] Now to run the tournament and save the results:: @@ -84,8 +84,7 @@ First, let us view the scores:: which gives:: - [[1.94, 1.927, 1.929, 1.962, 1.961, 1.977, 1.907, 1.948, 1.954, 1.967], [1.2, 1.146, 1.194, 1.215, 1.188, 1.191, 1.203, 1.2, 1.191, 1.179], [2.588, 2.588, 2.608, 2.624, 2.632, 2.596, 2.62, 2.592, 2.612, 2.572], [1.889, 1.976, 1.91, 1.888, 1.899, 1.893, 1.919, 1.926, 1.921, 1.912], [1.927, 1.95, 1.943, 1.944, 1.941, 1.943, 1.942, 1.942, 1.957, 1.951], [2.636, 2.532, 2.628, 2.58, 2.604, 2.648, 2.584, 2.556, 2.584, 2.62]] - + [[1.952, 1.943, 1.951, 1.96, 1.924, 1.943, 2.007, 1.966, 2.003, 1.963], [1.221, 1.185, 1.173, 1.218, 1.206, 1.218, 1.221, 1.224, 1.188, 1.221], [2.588, 2.616, 2.608, 2.632, 2.588, 2.624, 2.612, 2.532, 2.588, 2.564], [1.917, 1.896, 1.901, 1.884, 1.931, 1.896, 1.87, 1.912, 1.886, 1.899], [1.967, 1.94, 1.929, 1.934, 1.957, 1.959, 1.948, 1.95, 1.937, 1.955], [2.636, 2.664, 2.632, 2.592, 2.588, 2.644, 2.604, 2.572, 2.612, 2.588]] We see here that when we ran :code:`tournament.play()` it automatically repeated the round robin tournament 10 times (this is to deal with the stochasticity of the random players). The :code:`normalised_scores` contains a list of normalized scores for all players. @@ -104,20 +103,20 @@ Finally, to obtain the ranking in a helpful format with all the names:: which gives:: - ['Defector', 'Defector', 'Alternator', 'Tit For Tat', 'Random: 0.5', 'Cooperator'] - + ['Defector', 'Defector', 'Alternator', 'Tit For Tat', 'Random', 'Cooperator'] So in this particular instance our two defectors have won. -Let us write a little script that will throw in a new :code:`TitForTat` player until the Tit-For-Tat player wins:: +Let us write a little script that will throw in a new :code:`TitForTat` player until the tit for tat player wins:: - while results.ranked_names[0] == 'Defector': + while ranks[0] == 'Defector': strategies.append(axelrod.TitForTat()) # Adding a new tit for tat player tournament = axelrod.Tournament(strategies) results = tournament.play() + ranks = results.ranked_names Once that has run let us see how many :code:`TitForTat` players were required:: - results.ranked_names.count('Tit For Tat') + ranks.count('Tit For Tat') which gives:: @@ -126,7 +125,7 @@ which gives:: We can wrap all this in a function and use it to see how many :code:`TitForTat` are needed to overcome a varying number :code:`Defector`:: def find_number_of_tit_for_tat(number_of_defectors): - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] for d in range(number_of_defectors - 1): strategies.append(axelrod.Defector()) ranks = ['Defector'] # Creating a dummy list to start @@ -161,10 +160,10 @@ Graphics There are a variety of graphical outputs that the library can produce. -Let us see the global scores for the basic strategies:: +Let us see the global scores for the demo strategies:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() plot = axelrod.Plot(results) @@ -173,13 +172,13 @@ Let us see the global scores for the basic strategies:: We see the output of this here: -.. image:: http://axelrod-python.github.io/tournament/assets/basic_strategies_boxplot.svg +.. image:: _static/usage/demo_strategies_boxplot.svg :width: 50% :align: center If we run the same tournament but with 5 :code:`Defector` and 3 :code:`TitForTat` we get: -.. image:: _static/usage/basic_strategies-5-Defector-3-TitForTat.svg +.. image:: _static/usage/demo_strategies-5-Defector-3-TitForTat.svg :width: 50% :align: center @@ -190,7 +189,7 @@ By default the tournament is run for 200 rounds and repeated 10 times. This are the default values and can be changed:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies, turns=20, repetitions=50) results = tournament.play() plot = axelrod.Plot(results) @@ -198,7 +197,7 @@ the default values and can be changed:: p.show() -.. image:: _static/usage/basic_strategies_20_turns_50_repetitions.svg +.. image:: _static/usage/demo_strategies_20_turns_50_repetitions.svg :width: 50% :align: center @@ -208,7 +207,7 @@ that is repeated. Here is an example showing the standard strategies playing a scaled version of the standard game:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies, game=Game(30, 0, 50, 10)) results = tournament.play() plot = axelrod.Plot(results) @@ -216,7 +215,7 @@ scaled version of the standard game:: p.show() -.. image:: _static/usage/basic_strategies_scaled_games.svg +.. image:: _static/usage/demo_strategies_scaled_games.svg :width: 50% :align: center @@ -226,7 +225,7 @@ Payoff matrix Once a tournament has been run we can generate the payoff matrix that corresponds to it:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() results.payoff_matrix @@ -249,7 +248,7 @@ Again, if :code:`matplotlib` is installed we can visualise this:: this is shown here: -.. image:: http://axelrod-python.github.io/tournament/assets/basic_strategies_payoff.svg +.. image:: _static/usage/demo_strategies_payoff.svg :width: 50% :align: center @@ -366,23 +365,23 @@ Ecological variant To further study how this system evolves over time and how robust some of the observations we have made are let us look at how this game can be interpreted in an ecological setting. The previous examples seem to indicate that even with a large amount of :code:`Defector`, :code:`TitForTat` wins the tournament. -However, the Nash equilibria for the basic tournament shows that we have equilibria involving both those two strategies. +However, the Nash equilibria for the demo tournament shows that we have equilibria involving both those two strategies. An ecological variant of the tournament can be run with this library which allows to see how each strategy does in a population over time where the performance in the tournament indicates how likely the given strategy is to reproduce. To create such a variant simply run:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() eco = axelrod.Ecosystem(results) - eco.reproduce(50) # Evolve the population over 50 time steps + eco.reproduce(100) # Evolve the population over 100 time steps plot = axelrod.Plot(results) p = plot.stackplot(eco.population_sizes) p.show() We see the output here: -.. image:: http://axelrod-python.github.io/tournament/assets/basic_strategies_reproduce.svg +.. image:: _static/usage/demo_strategies_reproduce.svg :width: 50% :align: center @@ -392,7 +391,7 @@ The final population is completely cooperative. We can see how this differs when the initial population contains a large number of :code:`Defector`:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() eco = axelrod.Ecosystem(results, population=[.1, .05, .7, .1, .05]) @@ -403,14 +402,14 @@ We can see how this differs when the initial population contains a large number We see the output here: -.. image:: _static/usage/basic_strategies-reproduce-large-initial-D.svg +.. image:: _static/usage/demo_strategies-reproduce-large-initial-D.svg :width: 50% :align: center Here is a with an even larger initial number of :code:`Defector` (note that it takes a little longer to stabilise):: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() eco = axelrod.Ecosystem(results, population=[.1, .05, 7, .1, .05]) @@ -421,7 +420,7 @@ Here is a with an even larger initial number of :code:`Defector` (note that it t The output is shown here: -.. image:: _static/usage/basic_strategies-reproduce-huge-initial-D.svg +.. image:: _static/usage/demo_strategies-reproduce-huge-initial-D.svg :width: 50% :align: center @@ -441,7 +440,7 @@ where C(b) is the total number of turns where a player chose to cooperate and TT A matrix of cooperation rates is available within a tournament's ResultSet:: import axelrod - strategies = [s() for s in axelrod.basic_strategies] + strategies = [s() for s in axelrod.demo_strategies] tournament = axelrod.Tournament(strategies) results = tournament.play() results.normalised_cooperation