@@ -154,7 +154,7 @@ def test_strategy(self):
154
154
155
155
class TestTrickyLevelPunisher (TestPlayer ):
156
156
157
- name = "Level Punisher"
157
+ name = "Tricky Level Punisher"
158
158
player = axl .TrickyLevelPunisher
159
159
expected_classifier = {
160
160
"memory_depth" : float ("inf" ), # Long memory
@@ -171,25 +171,20 @@ def test_strategy(self):
171
171
actions = [(C , C )] * 9
172
172
self .versus_test (opponent = axl .Cooperator (), expected_actions = actions )
173
173
174
- # After 10 rounds
175
174
# Check if number of defections by opponent is greater than 20%
176
- opponent = axl .MockPlayer ([C ] * 4 + [D ] * 2 + [C ] * 3 + [D ])
177
- actions = [(C , C )] * 4 + [(C , D )] * 2 + [(C , C )] * 3 + [(C , D ), (D , C )]
175
+ op_actions = [C ] * 6 + [D ] * 4
176
+ opponent = axl .MockPlayer (op_actions )
177
+ actions = list (zip ([C ] * 7 + [D ] * 3 , op_actions ))
178
178
self .versus_test (opponent = opponent , expected_actions = actions )
179
179
180
180
# Check if number of defections by opponent is greater than 10%
181
- opponent = axl .MockPlayer ([C ] * 4 + [D ] + [C ] * 4 + [D ])
182
- actions = [(C , C )] * 4 + [(C , D )] + [(C , C )] * 4 + [(C , D ), (C , C )]
181
+ op_actions = [C ] * 8 + [D , C ]
182
+ opponent = axl .MockPlayer (op_actions )
183
+ actions = list (zip ([C ] * 9 + [D ], op_actions ))
183
184
self .versus_test (opponent = opponent , expected_actions = actions )
184
185
185
- # After 10 rounds
186
186
# Check if number of defections by opponent is greater than 5%
187
- opponent = axl .MockPlayer ([C ] * 4 + [D ] + [C ] * 5 )
188
- actions = [(C , C )] * 4 + [(C , D )] + [(C , C )] * 5
187
+ op_actions = [C ] * 18 + [D , C ]
188
+ opponent = axl .MockPlayer (op_actions )
189
+ actions = list (zip ([C ] * 19 + [D ], op_actions ))
189
190
self .versus_test (opponent = opponent , expected_actions = actions )
190
-
191
- # Check if number of defections by opponent is less than 5%
192
- opponent = axl .MockPlayer ([C ] * 10 )
193
- actions = [(C , C )] * 5
194
- self .versus_test (opponent = opponent , expected_actions = actions )
195
-
0 commit comments