Skip to content

Commit 141f646

Browse files
yohmmarcharper
authored andcommitted
fixed the doc & add a link to the original implementation
1 parent e32a008 commit 141f646

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

axelrod/strategies/grudger.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,24 @@ def strategy(opponent: Player) -> Action:
346346

347347
class Capri(Player):
348348
"""
349-
CAPRI is a memory-3 strategy proposed in [Murase2020]_. Its behavior is defined in[Murase2020]_ by the following five rules applied to the last 3 moves of the player and the opponent:
350-
C: Cooperate at mutual cooperation.
351-
This rule prescribes c at (ccc, ccc).
352-
A: Accept punishment when you mistakenly defected from mutual cooperation.
353-
This rule prescribes c at (ccd, ccc), (cdc, ccd), (dcc, cdc), and (ccc, dcc).
354-
P: Punish your co-player by defecting once when he defected from mutual cooperation.
355-
This rule prescribes d at (ccc, ccd), and then c at (ccd, cdc), (cdc, dcc), and (dcc, ccc).
356-
R: Recover cooperation when you or your co-player cooperated at mutual defection.
357-
This rule prescribes c at (ddd, ddc), (ddc, dcc), (dcc, ccc), (ddc, ddd), (dcc, ddc), (ccc, dcc), (ddc, ddc), and (dcc, dcc).
358-
I: In all the ohter cases, defect.
349+
CAPRI is a memory-3 strategy proposed in [Murase2020]_. Its behavior is
350+
defined by the following five rules applied to the last 3 moves of the
351+
player and the opponent:
352+
353+
- C: Cooperate at mutual cooperation. This rule prescribes c at (ccc, ccc).
354+
- A: Accept punishment when you mistakenly defected from mutual cooperation.
355+
This rule prescribes c at (ccd, ccc), (cdc, ccd), (dcc, cdc), and (ccc,
356+
dcc).
357+
- P: Punish your co-player by defecting once when he defected from mutual
358+
cooperation. This rule prescribes d at (ccc, ccd), and then c at (ccd,
359+
cdc), (cdc, dcc), and (dcc, ccc).
360+
- R: Recover cooperation when you or your co-player cooperated at mutual
361+
defection. This rule prescribes c at (ddd, ddc), (ddc, dcc), (dcc, ccc),
362+
(ddc, ddd), (dcc, ddc), (ccc, dcc), (ddc, ddc), and (dcc, dcc).
363+
- I: In all the other cases, defect.
364+
365+
The original implementation used in [Murase2020]_ is available at
366+
https://github.com/yohm/sim_exhaustive_m3_PDgame
359367
360368
Names:
361369

0 commit comments

Comments
 (0)