NetStim seeding question

Moderator: wwlytton

Post Reply
neurite
Posts: 13
Joined: Fri Jun 22, 2007 2:06 pm
Location: Boston University

NetStim seeding question

Post by neurite »

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:

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()
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?
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Too complex. When you're wrestling with something as basic as
"I'm having trouble telling NetStim to reseed"
then don't bother fooling around with anything more complicated than a single compartment
model with a single synaptic mechanism driven by a single afferent stream generated by a
single NetStim. Master elementary usage first, or you'll just waste time.
Post Reply