Skip to content

Commit aa417a1

Browse files
committed
Rename Shubik but make notes for further investigation.
1 parent 33c903f commit aa417a1

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

axelrod/strategies/_strategies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
FirstByJoss,
1414
FirstByNydegger,
1515
RevisedDowning,
16-
Shubik,
16+
FirstByShubik,
1717
SteinAndRapoport,
1818
TidemanAndChieruzzi,
1919
Tullock,
@@ -403,7 +403,7 @@
403403
SecondByRowsam,
404404
SelfSteem,
405405
ShortMem,
406-
Shubik,
406+
FirstByShubik,
407407
SlowTitForTwoTats2,
408408
SneakyTitForTat,
409409
SoftGrudger,

axelrod/strategies/axelrod_first.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,21 +514,37 @@ def strategy(self, opponent: Player) -> Action:
514514
return C
515515

516516

517-
class Shubik(Player):
517+
class FirstByShubik(Player):
518518
"""
519519
Submitted to Axelrod's first tournament by Martin Shubik.
520520
521+
The description written in [Axelrod1980]_ is:
522+
523+
> "This rule cooperates until the other defects, and then defects once. If
524+
> the other defects again after the rule's cooperation is resumed, the rule
525+
> defects twice. In general, the length of retaliation is increased by one for
526+
> each departure from mutual cooperation. This rule is described with its
527+
> strategic implications in Shubik (1970). Further treatment of its is given
528+
> in Taylor (1976).
529+
530+
This is interpreted as:
531+
521532
Plays like Tit-For-Tat with the following modification. After each
522533
retaliation, the number of rounds that Shubik retaliates increases by 1.
523534
535+
# TODO Read
536+
# https://www.jstor.org/stable/pdf/173263.pdf?refreqid=excelsior%3A94cf485d88f107de1d72296c4cf5d988
537+
# as supposedely there there is description indicating that the strategy
538+
# would cooperate twice. I do not think I agree but need to check carefully.
539+
524540
This strategy came 5th in Axelrod's original tournament.
525541
526542
Names:
527543
528544
- Shubik: [Axelrod1980]_
529545
"""
530546

531-
name = "Shubik"
547+
name = "First tournament by Shubik"
532548
classifier = {
533549
"memory_depth": float("inf"),
534550
"stochastic": False,

axelrod/tests/strategies/test_axelrod_first.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@ def test_strategy(self):
355355
self.versus_test(opponent, expected_actions=actions)
356356

357357

358-
class TestShubik(TestPlayer):
358+
class TestFirstByShubik(TestPlayer):
359359

360-
name = "Shubik"
361-
player = axelrod.Shubik
360+
name = "First tournament by Shubik"
361+
player = axelrod.FirstByShubik
362362
expected_classifier = {
363363
"memory_depth": float("inf"),
364364
"stochastic": False,

docs/reference/overview_of_strategies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ An indication is given as to whether or not this strategy is implemented in the
2020
"Tideman and Chieruzzi", "T Nicolaus Tideman and Paula Chieruzz", ":class:`TidemanAndChieruzzi <axelrod.strategies.axelrod_first.TidemanAndChieruzzi>`"
2121
"Nydegger", "Rudy Nydegger", ":class:`Nydegger <axelrod.strategies.axelrod_first.FirstByNydegger>`"
2222
"Grofman", "Bernard Grofman", ":class:`Grofman <axelrod.strategies.axelrod_first.FirstByGrofman>`"
23-
"Shubik", "Martin Shubik", ":class:`Shubik <axelrod.strategies.axelrod_first.Shubik>`"
23+
"Shubik", "Martin Shubik", ":class:`Shubik <axelrod.strategies.axelrod_first.FirstByShubik>`"
2424
"Stein and Rapoport", "Stein and Anatol Rapoport", ":class:`SteinAndRapoport <axelrod.strategies.axelrod_first.SteinAndRapoport>`"
2525
"Grudger", "James W Friedman", ":class:`Grudger <axelrod.strategies.grudger.Grudger>`"
2626
"Davis", "Morton Davis", ":class:`Davis <axelrod.strategies.axelrod_first.FirstByDavis>`"

0 commit comments

Comments
 (0)