File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ class AverageCopier(Player):
22
22
'manipulates_state' : False
23
23
}
24
24
25
- @staticmethod
26
- def strategy (opponent : Player ) -> Action :
25
+ def strategy (self , opponent : Player ) -> Action :
27
26
if len (opponent .history ) == 0 :
28
27
# Randomly picks a strategy (not affected by history).
29
28
return random_choice (0.5 )
@@ -45,8 +44,7 @@ class NiceAverageCopier(Player):
45
44
'manipulates_state' : False
46
45
}
47
46
48
- @staticmethod
49
- def strategy (opponent : Player ) -> Action :
47
+ def strategy (self , opponent : Player ) -> Action :
50
48
if len (opponent .history ) == 0 :
51
49
return C
52
50
p = opponent .cooperations // len (opponent .history )
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ class Forgiver(Player):
22
22
'manipulates_state' : False
23
23
}
24
24
25
- @staticmethod
26
- def strategy (opponent : Player ) -> Action :
25
+ def strategy (self , opponent : Player ) -> Action :
27
26
"""
28
27
Begins by playing C, then plays D if the opponent has defected more than 10 percent of the time
29
28
"""
@@ -50,8 +49,7 @@ class ForgivingTitForTat(Player):
50
49
'manipulates_state' : False
51
50
}
52
51
53
- @staticmethod
54
- def strategy (opponent : Player ) -> Action :
52
+ def strategy (self , opponent : Player ) -> Action :
55
53
"""
56
54
Begins by playing C, then plays D if,
57
55
the opponent has defected more than 10 percent of the time,
You can’t perform that action at this time.
0 commit comments