Page 1 of 1

randomization of simulation execution

Posted: Thu Apr 10, 2014 6:48 pm
by Yaeger
Hi, I am running a network simulation that makes use of the ranstream.hoc file from "The Randomness in Neuron Models" entry in the Documentation section on the website to connect neurons as in Hines & Carnevale, 2008 J Neurosci Methods. What I would like to now do is randomization of simulation execution. I want to change the seed value so that the connectivity is different when I run the simulation again. I am not sure how to set this seed value for MCellRan4. Thanks in advance.

Re: randomization of simulation execution

Posted: Fri Apr 11, 2014 3:50 pm
by ted
The RandomStream class defined by the code in ranstream.hoc uses the value of the Ran4 generator's high index to distinguish between individual streams used in a given simulation. What you want is a single action that will change all of the streams used in a simulation. That's what Ran4's low index is for, and you can specify a new low index with the hoc function mcell_ran4_init(); you'll find this documented in the discussion of MCellRan4 and also mcell_ran4_init.

That raises the question of how to manage the "seeds" that you will feed to mcell_ran4_init. You might want to create a "log" file that contains a single number that keeps track of how many simulations have been run. Your program could then read the log file, increment the number by 1 and write it back to the log file, then use the number as the low index.