@@ -600,17 +600,24 @@ class FirstByShubik(Player):
600
600
> strategic implications in Shubik (1970). Further treatment of its is given
601
601
> in Taylor (1976).
602
602
603
- This is interpreted as:
604
-
605
- Plays like Tit-For-Tat with the following modification. After each
606
- retaliation, the number of rounds that Shubik retaliates increases by 1.
603
+ There is some room for interpretation as to how the strategy reacts to a
604
+ defection on the turn where it starts to cooperate once more. In Shubik
605
+ (1970) the strategy is described as:
606
+
607
+ > "I will play my move 1 to begin with and will continue to do so, so long
608
+ > as my information shows that the other player has chosen his move 1. If my
609
+ > information tells me he has used move 2, then I will use move 2 for the
610
+ > immediate k subsequent periods, after which I will resume using move 1. If
611
+ > he uses his move 2 again after I have resumed using move 1, then I will
612
+ > switch to move 2 for the k + 1 immediately subsequent periods . . . and so
613
+ > on, increasing my retaliation by an extra period for each departure from the
614
+ > (1, 1) steady state."
607
615
608
- # TODO Read
609
- # https://www.jstor.org/stable/pdf/173263.pdf?refreqid=excelsior%3A94cf485d88f107de1d72296c4cf5d988
610
- # as supposedely there there is description indicating that the strategy
611
- # would cooperate twice. I do not think I agree but need to check carefully.
616
+ This is interpreted as:
612
617
613
- This strategy came 5th in Axelrod's original tournament.
618
+ The player cooperates, if when it is cooperating, the opponent defects it
619
+ defects for k rounds. After k rounds it starts cooperating again and
620
+ increments the value of k if the opponent defects again.
614
621
615
622
Names:
616
623
@@ -645,24 +652,21 @@ def _decrease_retaliation_counter(self):
645
652
def strategy (self , opponent : Player ) -> Action :
646
653
if not opponent .history :
647
654
return C
648
- if opponent .history [- 1 ] == D :
649
- # Retaliate against defections
650
- if self .history [- 1 ] == C : # it's on now!
651
- # Lengthen the retaliation period
652
- self .is_retaliating = True
653
- self .retaliation_length += 1
654
- self .retaliation_remaining = self .retaliation_length
655
- self ._decrease_retaliation_counter ()
656
- return D
657
- else :
658
- # Just retaliate
659
- if self .is_retaliating :
660
- self ._decrease_retaliation_counter ()
661
- return D
655
+
662
656
if self .is_retaliating :
663
657
# Are we retaliating still?
664
658
self ._decrease_retaliation_counter ()
665
659
return D
660
+
661
+ if opponent .history [- 1 ] == D and self .history [- 1 ] == C :
662
+ # "If he uses his move 2 again after I have resumed using move 1,
663
+ # then I will switch to move 2 for the k + 1 immediately subsequent
664
+ # periods"
665
+ self .is_retaliating = True
666
+ self .retaliation_length += 1
667
+ self .retaliation_remaining = self .retaliation_length
668
+ self ._decrease_retaliation_counter ()
669
+ return D
666
670
return C
667
671
668
672
0 commit comments