@@ -509,30 +509,27 @@ def test_strategy(self):
509
509
self .versus_test (axelrod .Cooperator (), expected_actions = actions )
510
510
511
511
# It will take until turn 18 to respond decide to repond D->D
512
- random .seed (1 )
513
512
actions = [(C , D )]
514
513
actions += [(C , D ), (D , D ), (D , D ), (C , D ), (C , D ), (C , D ), (D , D ),
515
514
(D , D ), (C , D ), (C , D ), (D , D ), (C , D ), (D , D ), (C , D ),
516
515
(C , D ), (D , D ), (C , D )] # Randomly choose
517
516
actions += [(D , D )] * 30 # Defect
518
- self .versus_test (axelrod .Defector (), expected_actions = actions )
517
+ self .versus_test (axelrod .Defector (), expected_actions = actions , seed = 1 )
519
518
520
519
# Highly-defective opponent
521
520
# It will take until turn 20 to respond decide to repond D to C
522
521
opponent_actions = [D ] * 17 + [C , C , C , C ]
523
522
almost_defector = axelrod .MockPlayer (actions = opponent_actions )
524
523
525
- random .seed (1 )
526
524
actions = [(C , D )]
527
525
actions += [(C , D ), (D , D ), (D , D ), (C , D ), (C , D ), (C , D ), (D , D ),
528
526
(D , D ), (C , D ), (C , D ), (D , D ), (C , D ), (D , D ), (C , D ),
529
527
(C , D ), (D , D ), (C , C )] # Randomly choose
530
528
actions += [(C , C )] # Coop for a minute
531
529
actions += [(D , C ), (D , C )]
532
- self .versus_test (almost_defector , expected_actions = actions )
530
+ self .versus_test (almost_defector , expected_actions = actions , seed = 1 )
533
531
534
532
#Here it will take until turn 40 to detect random and defect
535
- random .seed (2 )
536
533
actions = [(C , C )]
537
534
actions += [(C , D ), (D , C ), (C , D ), (D , C ), (C , D ), (C , C ), (C , D ),
538
535
(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (C , D ), (D , C ),
@@ -541,4 +538,4 @@ def test_strategy(self):
541
538
(C , D ), (D , C ), (C , D ), (D , C ), (C , D ), (D , C ), (C , D )] #Randomly choose
542
539
actions += [(D , C ), (C , D ), (D , C )] # 17 D have come, so tit for tat for a while
543
540
actions += [(D , D ), (D , C )] * 100 # Random finally detected
544
- self .versus_test (axelrod .Alternator (), expected_actions = actions )
541
+ self .versus_test (axelrod .Alternator (), expected_actions = actions , seed = 2 )
0 commit comments