JuliaRandom / RandomNumbers.jl

Random Number Generators for the Julia Language.
https://juliarandom.github.io/RandomNumbers.jl/stable
Other
97 stars 23 forks source link

Storing RNG state #58

Closed snirgaz closed 5 years ago

snirgaz commented 5 years ago

Is it possible to store (to a string/file etc.) and later load the RNG state in order to resume the random stream?

sunoru commented 5 years ago

Yes, you can easily store the RNG state by saving the fields of a RNG object. And when loading, you can just assign the fields back to a new object to restore the state.

snirgaz commented 5 years ago

Thanks!