|
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 |
|
@@ -42,98 +41,45 @@ The simplest way to install is:: |
42 | 41 |
|
43 | 42 | $ pip install axelrod |
44 | 43 |
|
45 | | -Here is an asciicast showing how to install and use the library: |
46 | | - |
47 | | -.. image:: https://asciinema.org/a/18590.png |
48 | | - :width: 50% |
49 | | - :target: https://asciinema.org/a/18590 |
50 | | - |
51 | 44 | Otherwise:: |
52 | 45 |
|
53 | 46 | $ git clone https://github.com/Axelrod-Python/Axelrod.git |
54 | 47 | $ cd Axelrod |
55 | 48 | $ python setup.py install |
56 | 49 |
|
57 | | -Note that (as documented at http://axelrod.readthedocs.org/) you do not need to |
58 | | -run the last step to use this package (you can run all the code from the root of |
59 | | -the directory). |
60 | | - |
61 | | -Results |
62 | | -======= |
63 | | - |
64 | | -This repository contains Python (2.7) code that reproduces the |
65 | | -tournament. To run the tournament, you simply need to: |
66 | | - |
67 | | -:: |
68 | | - |
69 | | - $ python run_axelrod |
70 | | - |
71 | | -This automatically outputs a ``png`` file with the results. You can see |
72 | | -the results from the latest run of the tournament here: |
73 | | - |
74 | | -.. figure:: ./assets/strategies_boxplot.png |
75 | | - :alt: |
76 | | - |
77 | | -You can see the results from the latest run of the tournament here with |
78 | | -the cheating strategies (which manipulate/read what the opponent does): |
79 | | - |
80 | | -.. figure:: ./assets/all_strategies_boxplot.png |
81 | | - :alt: |
82 | | - |
83 | | -Also the pairwise performance of each strategy versus all others: |
84 | | - |
85 | | -.. figure:: ./assets/strategies_payoff.png |
86 | | - :alt: |
| 50 | +Usage |
| 51 | +----- |
87 | 52 |
|
88 | | -Please do contribute :) |
89 | | - |
90 | | -Note that you can run ``python run_axelrod -h`` for further |
91 | | -options available: for example, cheating strategies can be excluded for |
92 | | -faster results by running: |
93 | | - |
94 | | -:: |
95 | | - |
96 | | - $ python run_axelrod --xc --xa |
97 | | - |
98 | | -You can also run the tournament in parallel (below will run 4 parallel |
99 | | -processes): |
100 | | - |
101 | | -:: |
102 | | - |
103 | | - $ python run_axelrod -p 4 |
104 | | - |
105 | | -You can run with all available CPUs with: |
106 | | - |
107 | | -:: |
108 | | - |
109 | | - $ python run_axelrod -p 0 |
| 53 | +The full documentation can be found here: |
| 54 | +`axelrod.readthedocs.org/ <http://axelrod.readthedocs.org/>`__. |
110 | 55 |
|
111 | | -Awesome visualisation |
112 | | ---------------------- |
| 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:: |
113 | 58 |
|
114 | | -`martinjc <https://github.com/martinjc>`__ put together a pretty awesome |
115 | | -visualisation of this using d3. Hosted on gh-pages it can be seen here: |
116 | | -`drvinceknight.github.io/Axelrod <http://drvinceknight.github.io/Axelrod/>`__. |
| 59 | + import axelrod |
| 60 | + strategies = [s() for s in axelrod.ordinary_strategies if s().stochastic] |
| 61 | + tournament = axelrod.Tournament(strategies) |
| 62 | + results = tournament.play() |
117 | 63 |
|
118 | | -Documentation |
119 | | -------------- |
| 64 | +The :code:`results` object now contains all the results we could need:: |
120 | 65 |
|
121 | | -There is currently a very sparse set of documentation up here: |
122 | | -`axelrod.readthedocs.org/ <http://axelrod.readthedocs.org/>`__. |
| 66 | + print(results.ranked_names) |
123 | 67 |
|
124 | | -To write/render the documenation locally, you will need |
125 | | -`sphinx <http://sphinx-doc.org/>`__: |
| 68 | +gives:: |
126 | 69 |
|
127 | | -:: |
| 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'] |
128 | 74 |
|
129 | | - $ pip install sphinx sphinx-autobuild mock |
130 | | - |
131 | | -Once you have sphinx: |
| 75 | +Results |
| 76 | +======= |
132 | 77 |
|
133 | | -:: |
| 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: |
134 | 81 |
|
135 | | - $ cd docs |
136 | | - $ make html |
| 82 | +.. image:: http://axelrod-python.github.io/tournament/assets/strategies_boxplot.svg |
137 | 83 |
|
138 | 84 | Contributing |
139 | 85 | ============ |
@@ -183,7 +129,7 @@ paper please list it here: |
183 | 129 | by `marcharper <https://github.com/marcharper>`_. |
184 | 130 | - `Axelrod-Python related blog articles |
185 | 131 | <http://www.thomascampbell.me.uk/category/axelrod.html>`_ |
186 | | - by `Uglyfruitcake <https://github.com/uglyfruitcake>`_. |
| 132 | + by `Uglyfruitcake <https://github.com/uglyfruitcake>`_. |
187 | 133 |
|
188 | 134 | .. |Join the chat at https://gitter.im/Axelrod-Python/Axelrod| image:: https://badges.gitter.im/Join%20Chat.svg |
189 | 135 | :target: https://gitter.im/Axelrod-Python/Axelrod?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge |
0 commit comments