Itโs great that the problem is solved! But I think I just realized why Alanโs method doesnโt work ...
When writing boost::variate_generator<boost::mt19937&,boost::normal_distribution<> > rng(gener, normal) you did not create another copy of gener because it is a link call, but you created another copy of normal using variate_generate .
So, instead of normal.reset , which only resets the original normal , you should use rng.distribution().reset() . But you can just save gener.seed() , which I suspect will have the same effect as rng.engine().seed() .
I tested it in my code and it worked as expected.
Well, just in case, someone doesnโt care :)
Vokram
source share