diff --git a/sharkfin/simulation.py b/sharkfin/simulation.py index ddff5e4..adab5ff 100644 --- a/sharkfin/simulation.py +++ b/sharkfin/simulation.py @@ -766,13 +766,13 @@ def __init__( fm_args=fm_args, ) - self.rng = rng if rng is not None else np.random.default_rng() - if seed: self.seed = seed elif hasattr(rng, "seed"): self.seed = rng.seed + self.rng = rng if rng is not None else np.random.default_rng(seed) + # TODO: Make this more variable. if a is not None: self.attention_rate = a diff --git a/simulate/run_any_simulation.py b/simulate/run_any_simulation.py index 8bdbf2a..1350a0e 100644 --- a/simulate/run_any_simulation.py +++ b/simulate/run_any_simulation.py @@ -379,6 +379,8 @@ def env_param(name, default): parameter_dict["aNrmInitMean"] = pop_aNrmInitMean else: raise Exception(f"No valid population named! Got {population_name}. Panic!") + + bigseed = rng.integers(0, 2**31 - 1) if args.simulation == "Attention": data, sim_stats, history, class_stats = run_attention_simulation( @@ -398,7 +400,7 @@ def env_param(name, default): mba=mba, rng=rng, pad=pad, - seed=seed, + seed=bigseed, ) elif args.simulation == "Calibration": data, sim_stats, history, class_stats = run_chum_simulation( @@ -412,7 +414,7 @@ def env_param(name, default): buy=buysize, sell=sellsize, pad=pad, - seed=seed, + seed=bigseed, ) else: print(