randomization of simulation execution

Anything that doesn't fit elsewhere.
Post Reply
Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

randomization of simulation execution

Post by Yaeger » Thu Apr 10, 2014 6:48 pm

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.

ted
Site Admin
Posts: 5601
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: randomization of simulation execution

Post by ted » Fri Apr 11, 2014 3:50 pm

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.

Post Reply