Skip to content

Commit 98c419a

Browse files
committed
Rewording the documentation to have a small example and pointing at the tournament repo
1 parent 0722113 commit 98c419a

File tree

1 file changed

+23
-67
lines changed

1 file changed

+23
-67
lines changed

README.rst

Lines changed: 23 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.. image:: https://badge.waffle.io/Axelrod-Python/Axelrod.svg?label=ready&title=Ready
22
:target: https://waffle.io/Axelrod-Python/Axelrod
33

4-
54
.. image:: https://coveralls.io/repos/Axelrod-Python/Axelrod/badge.svg
65
:target: https://coveralls.io/r/Axelrod-Python/Axelrod
76

@@ -48,82 +47,39 @@ Otherwise::
4847
$ cd Axelrod
4948
$ python setup.py install
5049

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+
-----
7952

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/>`__.
10355

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::
10758

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()
11063

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::
11365

114-
To write/render the documenation locally, you will need
115-
`sphinx <http://sphinx-doc.org/>`__:
66+
print(results.ranked_names)
11667

117-
::
68+
gives::
11869

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']
12074

121-
Once you have sphinx:
75+
Results
76+
=======
12277

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:
12481

125-
$ cd docs
126-
$ make html
82+
.. image:: http://axelrod-python.github.io/tournament/assets/strategies_boxplot.svg
12783

12884
Contributing
12985
============

0 commit comments

Comments
 (0)