Predictable seed for pseudo-random number generation

2012-07-20 Thread Joseph Rushton Wakeling
Hello all, Often when writing simulations with pseudo-random number generation you want to be able to use a predictable seed for testing purposes, e.g. to confirm whether an alteration to the code produces changes in output. In a single-threaded piece of code this is easy -- one can just put

Re: Predictable seed for pseudo-random number generation

2012-07-20 Thread Jonathan M Davis
On Friday, July 20, 2012 19:52:17 Joseph Rushton Wakeling wrote: > On a related note, is it possible to override the default random number > generator with another type? As long as rndGen isn't called with its full path (std.random.rndGen), any module which uses it could declare its own rndGen, a

Re: Predictable seed for pseudo-random number generation

2012-07-20 Thread Joseph Rushton Wakeling
On 20/07/12 19:59, Jonathan M Davis wrote: As long as rndGen isn't called with its full path (std.random.rndGen), any module which uses it could declare its own rndGen, and it would be used instead of std.random's, in which case you could do whatever you want with its type or seed. I did consid