Skip to content

Commit 168fc85

Browse files
Merge pull request #772 from Nikoleta-v3/strategies_documentation
More strategies documentation
2 parents fefa766 + 6a3c5bf commit 168fc85

File tree

7 files changed

+33
-9
lines changed

7 files changed

+33
-9
lines changed

axelrod/strategies/adaptive.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55

66
class Adaptive(Player):
77
"""Start with a specific sequence of C and D, then play the strategy that
8-
has worked best, recalculated each turn."""
8+
has worked best, recalculated each turn.
9+
10+
Names:
11+
12+
- Adaptive: [Li2011]_
13+
14+
"""
915

1016
name = 'Adaptive'
1117
classifier = {

axelrod/strategies/grudger.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Grudger(Player):
1313
- Grudger: [Li2011]_
1414
- Grim: [Berg2015]_
1515
- Grim Trigger: [Banks1980]_
16+
- Spite: [Beaufils1997]_
1617
"""
1718

1819
name = 'Grudger'

axelrod/strategies/handshake.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
class Handshake(Player):
77
"""Starts with C, D. If the opponent plays the same way, cooperate forever,
8-
else defect forever."""
8+
else defect forever.
9+
10+
Names:
11+
12+
- Handshake: [Robson1989]_
13+
"""
914

1015
name = 'Handshake'
1116
classifier = {

axelrod/strategies/memoryone.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,9 @@ def __init__(self, initial=C):
100100
class WinShiftLoseStay(MemoryOnePlayer):
101101
"""Win-Shift Lose-Stay, also called Reverse Pavlov.
102102
103-
For reference see: "Engineering Design of Strategies for Winning
104-
Iterated Prisoner's Dilemma Competitions" by Jiawei Li, Philip Hingston,
105-
and Graham Kendall. IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI
106-
IN GAMES, VOL. 3, NO. 4, DECEMBER 2011
103+
Names:
104+
105+
- WSLS: [Li2011]_
107106
"""
108107

109108
name = 'Win-Shift Lose-Stay'
@@ -125,7 +124,12 @@ def __init__(self, initial=D):
125124

126125

127126
class GTFT(MemoryOnePlayer):
128-
"""Generous Tit-For-Tat Strategy."""
127+
"""Generous Tit For Tat Strategy.
128+
129+
Names:
130+
131+
- Generous Tit For Tat: [Nowak1993]_
132+
"""
129133

130134
name = 'GTFT'
131135
classifier = {
@@ -165,8 +169,12 @@ def __repr__(self):
165169

166170

167171
class FirmButFair(MemoryOnePlayer):
168-
"""A Classical Strategy described in this paper (and earlier):
169-
http://www.math.ubc.ca/~hauert/publications/reprints/hauert_jtb02b.pdf"""
172+
"""A strategy that cooperates on the first move, and cooperates except after receiving a
173+
sucker payoff.
174+
175+
Names:
176+
177+
- Firm But Fair: [Frean1994]_"""
170178

171179
name = 'Firm But Fair'
172180

axelrod/strategies/rand.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Random(Player):
77
Names:
88
99
- Random: [Axelrod1980]_
10+
- Lunatic: [Tzafestas2000]_
1011
"""
1112

1213
name = 'Random'

axelrod/strategies/titfortat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class SuspiciousTitForTat(Player):
156156
Names:
157157
158158
- Suspicious Tit For Tat: [Hilde2013]_
159+
- Mistrust: [Beaufils1997]_
159160
"""
160161

161162
name = "Suspicious Tit For Tat"

docs/reference/bibliography.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ documentation.
1414
.. [Banks1980] Banks, J. S., & Sundaram, R. K. (1990). Repeated games, finite automata, and complexity. Games and Economic Behavior, 2(2), 97–117. http://doi.org/10.1016/0899-8256(90)90024-O
1515
.. [Beaufils1997] Beaufils, B. and Delahaye, J. (1997). Our Meeting With Gradual: A Good Strategy For The Iterated Prisoner’s Dilemma. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.4041
1616
.. [Berg2015] Berg, P. Van Den, & Weissing, F. J. (2015). The importance of mechanisms for the evolution of cooperation. Proceedings of the Royal Society B-Biological Sciences, 282.
17+
.. [Frean1994] Frean, Marcus R. “The Prisoner's Dilemma without Synchrony.” Proceedings: Biological Sciences, vol. 257, no. 1348, 1994, pp. 75–79. www.jstor.org/stable/50253.
1718
.. [Hilde2013] Hilbe, C., Nowak, M.A. and Traulsen, A. (2013). Adaptive dynamics of extortion and compliance, PLoS ONE, 8(11), p. e77886. doi: 10.1371/journal.pone.0077886.
1819
.. [Kraines1989] Kraines, D. & Kraines, V. Theor Decis (1989) 26: 47. doi:10.1007/BF00134056
1920
.. [Li2011] Li, J., Hingston, P., Member, S., & Kendall, G. (2011). Engineering Design of Strategies for Winning Iterated Prisoner ’ s Dilemma Competitions, 3(4), 348–360.
@@ -22,6 +23,7 @@ documentation.
2223
.. [Nowak1993] Nowak, M., & Sigmund, K. (1993). A strategy of win-stay, lose-shift that outperforms tit-for-tat in the Prisoner’s Dilemma game. Nature, 364(6432), 56–58. http://doi.org/10.1038/364056a0
2324
.. [Press2012] Press, W. H., & Dyson, F. J. (2012). Iterated Prisoner’s Dilemma contains strategies that dominate any evolutionary opponent. Proceedings of the National Academy of Sciences, 109(26), 10409–10413. http://doi.org/10.1073/pnas.1206569109
2425
.. [PRISON1998] LIFL (1998) PRISON. Available at: http://www.lifl.fr/IPD/ipd.frame.html (Accessed: 19 September 2016).
26+
.. [Robson1989] Robson, Arthur, (1989), EFFICIENCY IN EVOLUTIONARY GAMES: DARWIN, NASH AND SECRET HANDSHAKE, Working Papers, Michigan - Center for Research on Economic & Social Theory, http://EconPapers.repec.org/RePEc:fth:michet:89-22.
2527
.. [Singer-Clark2014] Singer-Clark, T. (2014). Morality Metrics On Iterated Prisoner’s Dilemma Players.
2628
.. [Slany2007] Slany W. and Kienreich W., On some winning strategies for the iterated prisoner’s dilemma, in Kendall G., Yao X. and Chong S. (eds.) The iterated prisoner’s dilemma: 20 years on. World Scientific, chapter 8, pp. 171-204, 2007.
2729
.. [Stewart2012] Stewart, a. J., & Plotkin, J. B. (2012). Extortion and cooperation in the Prisoner’s Dilemma. Proceedings of the National Academy of Sciences, 109(26), 10134–10135. http://doi.org/10.1073/pnas.1208087109

0 commit comments

Comments
 (0)