Skip to content

Commit fee3e53

Browse files
committed
Merge pull request #372 from Axelrod-Python/299
299 - Docs
2 parents 0c7ea49 + 3837859 commit fee3e53

36 files changed

+1192
-480
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ _build/
55
*.log
66
dist/
77
MANIFEST
8+
Axelrod.egg-info

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ script:
2020
- cd ..
2121
- coverage run --source=axelrod -m unittest discover
2222
- coverage report -m
23+
# Run the doctests
24+
- sh doctest
2325
after_success:
2426
- coveralls

docs/auto_generate_strategies_list.py

Lines changed: 0 additions & 42 deletions
This file was deleted.
File renamed without changes.

docs/description.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/index.rst

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,14 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to the documentation for an implementation of Axelrod's tournament in Python
7-
====================================================================================
8-
9-
This project is both:
10-
11-
* A python library that reproduces Axelrod's tournament.
12-
* A github experiment allowing anyone to contribute a strategy.
13-
14-
15-
Contents:
6+
Welcome to the documentation for the Axelrod Python library
7+
===========================================================
168

179
.. toctree::
1810
:maxdepth: 2
1911

20-
background
21-
usage
22-
overview_of_strategies
23-
index_of_strategies
24-
contributing
12+
tutorials/index.rst
13+
reference/index.rst
2514

2615

2716
Indices and tables

docs/index_of_strategies.rst

Lines changed: 0 additions & 90 deletions
This file was deleted.

docs/reference/glossary.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Glossary
2+
========
3+
4+
There are a variety of terms used in the documentation and throughout the
5+
library. Here is an overview:
6+
7+
An action
8+
---------
9+
10+
An **action** is either :code:`C` or :code:`D`.
11+
You can access these actions as follows but should not really have a reason to::
12+
13+
>>> import axelrod as axl
14+
>>> axl.Actions.C
15+
'C'
16+
>>> axl.Actions.D
17+
'D'
18+
19+
A play
20+
------
21+
22+
A **play** is a single player choosing an **action**.
23+
In terms of code this is equivalent to::
24+
25+
>>> p1, p2 = axl.Cooperator(), axl.Defector()
26+
>>> p1.play(p2) # This constitues two 'plays' (p1 plays and p2 plays).
27+
28+
This is equivalent to :code:`p2.play(p1)`. Either function invokes both
29+
:code:`p1.strategy(p2)` and :code:`p2.strategy(p1)`.
30+
31+
A turn
32+
------
33+
34+
A **turn** is a 1 shot interaction between two players. It is in effect a
35+
composition of two **plays**.
36+
37+
Each turn has four possible outcomes of a play: :code:`(C, C)`, :code:`(C, D)`,
38+
:code:`(D, C)`, or :code:`(D, D)`.
39+
40+
A match
41+
-------
42+
43+
A **match** is a consecutive number of **turns**. The default number of turns
44+
used in the tournament is 200. Here is a single match between two players over
45+
10 turns::
46+
47+
>>> p1, p2 = axl.Cooperator(), axl.Defector()
48+
>>> for turn in range(10):
49+
... p1.play(p2)
50+
>>> p1.history, p2.history
51+
(['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'], ['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D'])
52+
53+
A win
54+
-----
55+
56+
A **win** is attributed to the player who has the higher total score at the end
57+
of a match. For the example above, :code:`Defector` would win that match.
58+
59+
A round robin
60+
-------------
61+
62+
A **round robin** is the set of all potential (order invariant) matches between
63+
a given collection of players.
64+
65+
A tournament
66+
------------
67+
68+
A **tournament** is a repetition of round robins so as to smooth out stochastic effects.

docs/reference/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Reference
2+
=========
3+
4+
This section is the reference guide for the various components of the library.
5+
6+
Contents:
7+
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
overview_of_strategies.rst
12+
glossary.rst

0 commit comments

Comments
 (0)