Netstim in automated repeating simulations
Posted: Sun Sep 13, 2020 12:52 am
I planned to implement a automated repeating simulations scheme to a NEURON network model (running in parallel), with each simulation, cells may receive or abandon external inputs by Netstim. Before I go for the network-level, I tested this scheme in a single neuron model, and I made it work as I wanted, however, something was confusing me:
Below is the code for the single cell model (partially Pseudocode)
In the example code, the simulation was ran two times: for the first time, Netstim events was delivered through the synapse; for the second time, I wanted to remove the synapse by emptying the lists of synlist and nclist ( synlist=new List(), nclist=new List() ), and also by not calling proc givenstim () but this didn't work, and there were still events delivered and cell responded. The solution was, I have to re-declare stim by objref stim, then the second time of simulation worked without Netstim.
I first want to know whether this is the right solution. Also, I remember I saw some posts that, once if the synlist and nclist are emptied, synapses should not be functioning, but it seems this is not the case in my example, want to know why?
Thanks in advance.
Below is the code for the single cell model (partially Pseudocode)
Code: Select all
proc givenstim (){ ////this procedure defines the stimulate from Netstim
m=$1
start=$2
stim = new NetStim()
stim.start = start
stim.number = 10e20
stim.interval = 20
stim.noise=1
cell.soma syn = new Exp2Syn(0.9) //or any user-defined synapse file
synlist.append(syn)
nc = new NetCon(stim,syn,0,0,1)
nclist.append(nc)
}
proc batchrun() { ///this procedure defines how to run the simulation for each sub-run
synlist=new List()
nclist=new List()
objref stim
print i
if ($1==0) {
givenstim(22,100) ///only first sub-run build synapse and deliver Netstim events
}
run()
}
run_time=2 ///how many time to run the simulation
for i=0,run_time-1 {
batchrun(i)
}
I first want to know whether this is the right solution. Also, I remember I saw some posts that, once if the synlist and nclist are emptied, synapses should not be functioning, but it seems this is not the case in my example, want to know why?
Thanks in advance.