Open kellypierce opened 3 years ago
The current way of doing this is to generate an integer seed seed_state
at every step, managed by this process:
...and consumed by processes when they need to perform some kind of stochastic draw, e.g. for sigma:
Currently, the numpy.random.Generator
instance gets constructed by different processes when they call the get_rng
util:
There are two levels of stochasticity possible: stochastic parameter draws, e.g. sampling
sigma
from a triangular distribution as inhttps://github.com/eho-tacc/episimlab/blob/d70b69066082a2e3526e1830e06272a03db74714/episimlab/setup/greek/sigma.py#L23
and stochastic state transitions as implemented in
compt_model.py
: https://github.com/eho-tacc/episimlab/blob/e74c298f964d015fde4813ceac6666a68cf97af3/episimlab/compt_model.py#L126The individual parameters each have their own setup methods, giving flexibility on distribution use for each parameter. In contrast, state transitions will always share the same assumption on underlying probability distribution (if one is Poisson, all are Poisson).
But different models or different researchers might want to switch from Poisson to Binomial. A possible implementation would be a setup class for the state transitions, so when a user is writing a model file (their own version of
models/partition_v1.py
, they can use that setup class to select Poisson or Binomial state transitions.