Page 1 of 1

NetStim seed

Posted: Mon Jun 27, 2011 6:55 pm
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("network of")

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								

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.


Re: NetStim seed

Posted: Tue Jun 28, 2011 12:10 pm
by MSN
I did it using:

Code: Select all

objref r, pc
pc = new ParallelContext()
r = new Random(pc.time())

Re: NetStim seed

Posted: Wed Jun 29, 2011 1:41 pm
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.