NetStim seed

The basics of how to develop, test, and use models.
Post Reply
MSN
Posts: 10
Joined: Mon May 23, 2011 5:38 pm

NetStim seed

Post by MSN »

Dear TED

In the following code, I am using the seed function and the argument to the seed function is a random number.

Code: Select all

load_file("nrngui.hoc")
load_file("network of layers.ses")

n=15
objref syne[n], nse[n], nce[n], r
r = new Random()

proc layer () { 
for j=0, n-1 {
v=int(r.uniform(50, 100))

M_Cell[j].dend syne[j] = new ExpSyn(0.02)

M_Cell[j].dend nse[j]= new NetStim(0.04)
nse[j].interval= 5								
nse[j].number=1000
nse[j].start=0
nse[j].noise=1
nse[j].seed(v)

nce[j] = new NetCon(nse[j], syne[j]) 
nce[j].weight = 0.01
}
}

I was expecting that during various trials, there will be a different poisson process.

But every time, i run the simulation, it produces the same spike.

May you guide me, what should I do to have a different signal, each time I run the simulation.


Regards
MSN
Posts: 10
Joined: Mon May 23, 2011 5:38 pm

Re: NetStim seed

Post by MSN »

I did it using:

Code: Select all

objref r, pc
pc = new ParallelContext()
r = new Random(pc.time())
r.uniform(0,10)
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NetStim seed

Post by ted »

That's OK for demonstration purposes, but if you ever have to debug your code you'll need to use a user-specified constant as the seed--otherwise you won't have reproducible results, and without reproducibility it can be very difficult, if not impossible, to debug code.
Post Reply