|
1 |
| -from axelrod.actions import Actions |
| 1 | + |
| 2 | +from axelrod.actions import Actions, Action |
2 | 3 | from axelrod.player import Player
|
3 | 4 |
|
4 | 5 | C, D = Actions.C, Actions.D
|
@@ -26,11 +27,11 @@ class APavlov2006(Player):
|
26 | 27 | 'manipulates_state': False
|
27 | 28 | }
|
28 | 29 |
|
29 |
| - def __init__(self): |
| 30 | + def __init__(self) -> None: |
30 | 31 | super().__init__()
|
31 |
| - self.opponent_class = None |
| 32 | + self.opponent_class = "" |
32 | 33 |
|
33 |
| - def strategy(self, opponent): |
| 34 | + def strategy(self, opponent: Player) -> Action: |
34 | 35 | # TFT for six rounds
|
35 | 36 | if len(self.history) < 6:
|
36 | 37 | return D if opponent.history[-1:] == [D] else C
|
@@ -93,11 +94,11 @@ class APavlov2011(Player):
|
93 | 94 | 'manipulates_state': False
|
94 | 95 | }
|
95 | 96 |
|
96 |
| - def __init__(self): |
| 97 | + def __init__(self) -> None: |
97 | 98 | super().__init__()
|
98 |
| - self.opponent_class = None |
| 99 | + self.opponent_class = "" |
99 | 100 |
|
100 |
| - def strategy(self, opponent): |
| 101 | + def strategy(self, opponent: Player) -> Action: |
101 | 102 | # TFT for six rounds
|
102 | 103 | if len(self.history) < 6:
|
103 | 104 | return D if opponent.history[-1:] == [D] else C
|
|
0 commit comments