|
1 | 1 | .. image:: https://badge.waffle.io/Axelrod-Python/Axelrod.svg?label=ready&title=Ready |
2 | 2 | :target: https://waffle.io/Axelrod-Python/Axelrod |
3 | 3 |
|
4 | | - |
5 | 4 | .. image:: https://coveralls.io/repos/Axelrod-Python/Axelrod/badge.svg |
6 | 5 | :target: https://coveralls.io/r/Axelrod-Python/Axelrod |
7 | 6 |
|
@@ -48,82 +47,39 @@ Otherwise:: |
48 | 47 | $ cd Axelrod |
49 | 48 | $ python setup.py install |
50 | 49 |
|
51 | | -Results |
52 | | -======= |
53 | | - |
54 | | -This repository contains Python (2.7) code that reproduces the |
55 | | -tournament. To run the tournament, you simply need to: |
56 | | - |
57 | | -:: |
58 | | - |
59 | | - $ python run_axelrod |
60 | | - |
61 | | -This automatically outputs a ``png`` file with the results. You can see |
62 | | -the results from the latest run of the tournament here: |
63 | | - |
64 | | -.. figure:: ./assets/strategies_boxplot.png |
65 | | - :alt: |
66 | | - |
67 | | -You can see the results from the latest run of the tournament here with |
68 | | -the cheating strategies (which manipulate/read what the opponent does): |
69 | | - |
70 | | -.. figure:: ./assets/all_strategies_boxplot.png |
71 | | - :alt: |
72 | | - |
73 | | -Also the pairwise performance of each strategy versus all others: |
74 | | - |
75 | | -.. figure:: ./assets/strategies_payoff.png |
76 | | - :alt: |
77 | | - |
78 | | -Please do contribute :) |
| 50 | +Usage |
| 51 | +----- |
79 | 52 |
|
80 | | -Note that you can run ``python run_axelrod -h`` for further |
81 | | -options available: for example, cheating strategies can be excluded for |
82 | | -faster results by running: |
83 | | - |
84 | | -:: |
85 | | - |
86 | | - $ python run_axelrod --xc --xa |
87 | | - |
88 | | -You can also run the tournament in parallel (below will run 4 parallel |
89 | | -processes): |
90 | | - |
91 | | -:: |
92 | | - |
93 | | - $ python run_axelrod -p 4 |
94 | | - |
95 | | -You can run with all available CPUs with: |
96 | | - |
97 | | -:: |
98 | | - |
99 | | - $ python run_axelrod -p 0 |
100 | | - |
101 | | -Awesome visualisation |
102 | | ---------------------- |
| 53 | +The full documentation can be found here: |
| 54 | +`axelrod.readthedocs.org/ <http://axelrod.readthedocs.org/>`__. |
103 | 55 |
|
104 | | -`martinjc <https://github.com/martinjc>`__ put together a pretty awesome |
105 | | -visualisation of this using d3. Hosted on gh-pages it can be seen here: |
106 | | -`drvinceknight.github.io/Axelrod <http://drvinceknight.github.io/Axelrod/>`__. |
| 56 | +The documentation includes details of how to setup a tournament but here is an |
| 57 | +example showing how to create a tournament with all stochastic strategies:: |
107 | 58 |
|
108 | | -Documentation |
109 | | -------------- |
| 59 | + import axelrod |
| 60 | + strategies = [s() for s in axelrod.ordinary_strategies if s().stochastic] |
| 61 | + tournament = axelrod.Tournament(strategies) |
| 62 | + results = tournament.play() |
110 | 63 |
|
111 | | -There is currently a very sparse set of documentation up here: |
112 | | -`axelrod.readthedocs.org/ <http://axelrod.readthedocs.org/>`__. |
| 64 | +The :code:`results` object now contains all the results we could need:: |
113 | 65 |
|
114 | | -To write/render the documenation locally, you will need |
115 | | -`sphinx <http://sphinx-doc.org/>`__: |
| 66 | + print(results.ranked_names) |
116 | 67 |
|
117 | | -:: |
| 68 | +gives:: |
118 | 69 |
|
119 | | - $ pip install sphinx sphinx-autobuild mock |
| 70 | + ['Inverse', 'Forgetful Fool Me Once', 'Nice Average Copier', 'Champion', |
| 71 | + 'Generous Tit-For-Tat', 'Eatherley', 'ZD-GTFT-2', 'Meta Majority', 'Soft Joss', |
| 72 | + 'Average Copier', 'Feld', 'Stochastic WSLS', 'Tullock', 'Joss', 'ZD-Extort-2', |
| 73 | + 'Grofman', 'Random', 'Meta Winner', 'Meta Minority'] |
120 | 74 |
|
121 | | -Once you have sphinx: |
| 75 | +Results |
| 76 | +======= |
122 | 77 |
|
123 | | -:: |
| 78 | +A tournament with the full set of strategies from the library can be found at |
| 79 | +https://github.com/Axelrod-Python/tournament. Here is the latest graphical |
| 80 | +version of the results: |
124 | 81 |
|
125 | | - $ cd docs |
126 | | - $ make html |
| 82 | +.. image:: http://axelrod-python.github.io/tournament/assets/strategies_boxplot.svg |
127 | 83 |
|
128 | 84 | Contributing |
129 | 85 | ============ |
|
0 commit comments