File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ from typing import Any , Dict
12from axelrod .action import Action
23from axelrod .evolvable_player import (
34 EvolvablePlayer ,
@@ -71,9 +72,11 @@ def __init__(
7172 self .transitions_D = transitions_D
7273 self .emission_probabilities = emission_probabilities
7374 self .state = initial_state
74- self ._cache_C = dict ()
75- self ._cache_D = dict ()
75+ self ._cache_C = dict () # type: Dict[int, int]
76+ self ._cache_D = dict () # type: Dict[int, int]
7677 self ._cache_deterministic_transitions ()
78+ # Random generator will be set by parent strategy
79+ self ._random = None # type: Any
7780
7881 def _cache_deterministic_transitions (self ):
7982 """Cache deterministic transitions to avoid unnecessary random draws."""
@@ -217,6 +220,7 @@ def set_seed(self, seed=None):
217220 super ().set_seed (seed = seed )
218221 # Share RNG with HMM
219222 # The evolvable version of the class needs to manually share the rng with the HMM.
223+ # after initialization.
220224 try :
221225 self .hmm ._random = self ._random
222226 except AttributeError :
You can’t perform that action at this time.
0 commit comments