Seed source for Random class

Anything that doesn't fit elsewhere.
Post Reply
Site Admin
Posts: 5770
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Seed source for Random class

Post by ted »

On 2/23/2005 a NEURON user wrote:
> What is the standard way in NEURON to generate a different series of
> random numbers each execution - i.e., to define a different seed for the
> Random() class at runtime (or at selected times during execution or
> whatever)? One way would be to read some unpredictable system value
> like the milliseconds value of the system clock, and make that value the
> seed, but I don't know how to do that in NEURON.

On 2/23/2005 Michael Hines wrote:
startsw() returns a value increased by 1 every second since, I believe,
sometime in 1970. However I would recommend the use of a file containing
a number which is read, incremented by 1, and written for each simulation
and is used to specify the mcell_ran_init(lowindex) ... _ran4_init
(be sure to save the number also if you ever think you will want to rerun
a quantitatively identical simulation). I would also use the mcell_ran4 generator
for all random numbers needed by mod files
( ... mcell_ran4)
and for the Random class ... #MCellRan4

Post Reply