Skip to content

Commit 2edcd9d

Browse files
committed
Merge pull request #428 from Axelrod-Python/403
403 Adding play contexts and RPST to docs
2 parents c57e786 + ba5428d commit 2edcd9d

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
File renamed without changes.

docs/reference/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ Contents:
88
.. toctree::
99
:maxdepth: 2
1010

11+
description.rst
12+
play_contexts.rst
1113
overview_of_strategies.rst
1214
glossary.rst

docs/reference/play_contexts.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Play Contexts and Generic Prisoner's Dilemma
2+
============================================
3+
4+
There are four possible round outcomes:
5+
6+
- Mutual cooperation: :math:`(C, C)`
7+
- Defection: :math:`(C, D)` or :math:`(D, C)`
8+
- Mutual defection: :math:`(D, D)`
9+
10+
Each of these corresponds to one particular set of payoffs in the following
11+
generic Prisoner's dilemma:
12+
13+
14+
+----------+---------------+---------------+
15+
| | Cooperate | Defect |
16+
+==========+===============+===============+
17+
|Cooperate | (R,R) | (S,T) |
18+
+----------+---------------+---------------+
19+
|Defect | (T,S) | (P,P) |
20+
+----------+---------------+---------------+
21+
22+
For the above to constitute a Prisoner's dilemma, the following must hold:
23+
:math:`T>R>P>S`.
24+
25+
These payoffs are commonly referred to as:
26+
27+
- :math:`R`: the **Reward** payoff (default value in the library: 3)
28+
- :math:`P`: the **Punishment** payoff (default value in the library: 1)
29+
- :math:`S`: the **Sucker** payoff (default value in the library: 0)
30+
- :math:`T`: the **Temptation** payoff (default value in the library: 5)
31+
32+
A particular Prisoner's Dilemma is often described by the 4-tuple: :math:`(R, P,
33+
S, T)`::
34+
35+
>>> import axelrod
36+
>>> axelrod.game.DefaultGame.RPST()
37+
(3, 1, 0, 5)

0 commit comments

Comments
 (0)