@@ -154,7 +154,7 @@ def test_strategy(self):
154154
155155class TestTrickyLevelPunisher (TestPlayer ):
156156
157- name = "Level Punisher"
157+ name = "Tricky Level Punisher"
158158 player = axl .TrickyLevelPunisher
159159 expected_classifier = {
160160 "memory_depth" : float ("inf" ), # Long memory
@@ -171,25 +171,20 @@ def test_strategy(self):
171171 actions = [(C , C )] * 9
172172 self .versus_test (opponent = axl .Cooperator (), expected_actions = actions )
173173
174- # After 10 rounds
175174 # 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 ))
178178 self .versus_test (opponent = opponent , expected_actions = actions )
179179
180180 # 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 ))
183184 self .versus_test (opponent = opponent , expected_actions = actions )
184185
185- # After 10 rounds
186186 # 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 ))
189190 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