NetStim seeding question
Posted: Wed Jul 25, 2007 5:06 pm
Hi,
I'm having trouble telling NetStim to reseed, by that I mean I set the noise value of a NetStim object to 1, so that the process should behave like a poisson process, but the output is not random. Please consider the following code:
When I run the above code repeatedly and graph the outputs I get the exact same outputs all the time. However, if I were to load the code into nrngui without quiting, and then click the run button on run control, then I get different outputs, which is what I want. So clearly there is some issues with the initialization/random seeding in NetStim. How do I modify my code so that I can get a different resulting output in my data files each time I run the above code?
I'm having trouble telling NetStim to reseed, by that I mean I set the noise value of a NetStim object to 1, so that the process should behave like a poisson process, but the output is not random. Please consider the following code:
Code: Select all
load_file("scneuron.hoc")
syn_num = 10
run_time = 1000 //must be at least 1000ms
period = 1000 //period for poisson firing process
//resolution of different parts of cells
soma_res = 1000
dend_res = 1000
cell_res = 1000
objref presyncell[syn_num]
objref postsyncell
objref syn[syn_num]
postsyncell = new scneuron(cell_res)
//defines presyncell properties
for i=0, syn_num-1{
presyncell[i] = new NetStim()
presyncell[i].noise = 1 // for negexp ISIs
presyncell[i].interval = period
presyncell[i].number = run_time/period
presyncell[i].start = 0
}
//places the presyncell in random positions in the soma
for i=0, syn_num-1{
randpos = u_rand()
postsyncell.soma syn[i] = new Exp2Syn (randpos)
randflag = u_rand()
syn[i].tau1 = .25
syn[i].tau2 = 8
if (randflag < .5){
syn[i].e = -65
}
if (randflag > .5){
syn[i].e = 10
}
}
//connects the postsyncell and presyncell to respective synapse objects
for i=0, syn_num-1{
presyncell[i] postsyncell.nclist.append(new NetCon(presyncell[i], syn[i], -40, 0, .01))
}
//define some vector objects and use record() to record some data to them...
run()
//define a matrix object and to output the recorded data into a data file...
quit()