1
+ import random
2
+
1
3
import axelrod as axl
2
4
from axelrod .interaction_utils import compute_final_score
3
5
from axelrod .action import Action
@@ -57,15 +59,15 @@ def original_function(self, value):
57
59
self .__original_function .restype = c_int
58
60
59
61
def original_strategy (
60
- self , their_last_move , move_number , my_score , their_score , noise ,
62
+ self , their_last_move , move_number , my_score , their_score , random_value ,
61
63
my_last_move
62
64
):
63
65
args = (
64
66
c_int (their_last_move ), c_int (move_number ), c_int (my_score ),
65
- c_int (their_score ), c_float (noise ), c_int (my_last_move ))
67
+ c_int (their_score ), c_float (random_value ), c_int (my_last_move ))
66
68
return self .original_function (* [byref (arg ) for arg in args ])
67
69
68
- def strategy (self , opponent , noise = 0 ):
70
+ def strategy (self , opponent ):
69
71
if not self .history :
70
72
their_last_move = 0
71
73
scores = (0 , 0 )
@@ -76,8 +78,9 @@ def strategy(self, opponent, noise=0):
76
78
game = self .game )
77
79
my_last_move = original_actions [self .history [- 1 ]]
78
80
move_number = len (self .history ) + 1
81
+ random_value = random .random ()
79
82
original_action = self .original_strategy (
80
- their_last_move , move_number , scores [0 ], scores [1 ], noise ,
83
+ their_last_move , move_number , scores [0 ], scores [1 ], random_value ,
81
84
my_last_move )
82
85
return actions [original_action ]
83
86
0 commit comments