Closed bbolker closed 3 years ago
Thanks for bringing this to my attention!
It seemed I was calling R's RNG functions without calling all of the required functions as documented in section 6.3 of Writing R Extensions. I used Rcpp's RNGScope (as discussed by Dirk Eddelbuettel here) to solve the problem.
Installing the latest release of GillespieSSA2 should resolve this issue.
I get identical dynamics when I run a
GillespieSSA2
model twice in a row. I can't find any discussion of random seeds (setting/resetting/etc.) in the package/repository, despite the fact thatset.seed()
is used in the examples. The example below is adapted from the Lotka-Volterra vignette, but I think this is general ... (is some environment being stored/reset in a way that accidentally restores the previous state of the random-number seed?)Using
set.seed(2)
before the second run does make the results different, but unless I'm very confused (always a possibility) this feels like something that needs to be documented ??