Skip to content

Commit 26eee39

Browse files
committed
Update random number generation to use a reproducible seed in line with the Axelrod library
1 parent fba2749 commit 26eee39

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/axelrod_fortran/player.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(self, original_name):
5151
if is_stochastic is not None:
5252
self.classifier['stochastic'] = is_stochastic
5353

54-
5554
def __enter__(self):
5655
return self
5756

@@ -105,7 +104,7 @@ def strategy(self, opponent):
105104
my_last_move = original_actions[self.history[-1]]
106105
move_number = len(self.history) + 1
107106
if self.classifier["stochastic"]:
108-
random_value = random.random()
107+
random_value = self._random.random()
109108
else:
110109
random_value = 0
111110
original_action = self.original_strategy(

0 commit comments

Comments
 (0)