Closed randomshinichi closed 3 years ago
Example of use:
# declare this outside of the policy/state update functions
NUMBER_OF_MONTE_CARLO_RUNS = 5 # make sure to set this to the actual number
rngs = [np.random.RandomState(i) for i in range(NUMBER_OF_MONTE_CARLO_RUNS)]
# use inside policy/state update functions like this
def policy_function(params, step, state_history, prev_state):
rng = rngs[prev_state['run'] - 1]
random_value = rng.beta(params['a'], params['b']) # or whatever other method from numpy.random.RandomState
Use the cadCAD random seed functionality (investigate) to toggle between randomness or predictable outcomes (for integration tests)