-
-
Couldn't load subscription status.
- Fork 76
Description
For JumpProcesses's JumpProblems you can do
using JumpProcesses, StableRNGs
rng = StableRNG(12345)
jprob = JumpProblem(no_param_network, dprob, Direct(); rng = rng)
sol1 = solve(jprob, SSAStepper())
sol2 = solve(jprob, SSAStepper())
sol3 = solve(jprob, SSAStepper())and now, while sol1, sol2, and sol3 are different, they will yield reproducibly the same result each time I rerun the above snippet (useful to e.g. remove any randomness from tests). Note, this si different from setting a seed, where if I do:
using JumpProcesses, StableRNGs
jprob = JumpProblem(no_param_network, dprob, Direct(); seed = 1234)
sol1 = solve(jprob, SSAStepper())
sol2 = solve(jprob, SSAStepper())
sol3 = solve(jprob, SSAStepper())sol1, sol2, and sol3 will be identical.
StochasticDiffEq does not have a feature like this (and is only able to set seeds, however, it would be useful.
It is possible to partially circumvent this by setting different seeds for each sol (potentially depending on the StableRNG). However, long-term, being able to provide a stable rng to a SDEProblem directly would be ideal.