I'm a new user of NEURON (and French so excuse my English).
For my master project I need to understand event-based simulation so I have begun with the IntFire2 model (because it is very close to what I have to do). Here is the code of the NET_RECEIVE block (the cell is called IntFire2Mathieu :):
Code: Select all
NET_RECEIVE (w) {LOCAL ts_
://Update the value of i just before the spike i(t0-)
update_i(t)
://Update the value of m just before the spike m(t0-)
m = comp_m(t)
IF (INFO) {printf("Net_Receive: t=%g, w=%g, m=%g, i=%g, ts=%g\n", t, w, m, i, ts)}
if (flag == 1) { : time to fire
IF (INFO) {printf("\tSpike at t=%g\n", t)}
net_event(t)
m = 0
m0 = 0
synaptic_event(t)
ts_ = firetime()
net_send(ts_, 1)
}else{
IF (INFO) {printf("\tReceive a spike at t=%g. Last synaptic event at t0=%g\n", t, t0)}
://The spike change the value of i by w: i(t0+) = i(t0-) + w
i = i + w
IF (DEBUG) {printf("\ti updated by w: i=%g\n", i)}
://Save the values needed to compute m: t0, m0, i0
synaptic_event(t)
IF (DEBUG) {printf("\tSaving the values needed to compute m(t): t0=%g, m0=%g, i0=%g\n", t0, m0, i0)}
://We can compute the new constants
a = ib
b = (i - ib)*taus/(taus-taum)
c = m0
if (m >= 1) {
net_move(t) : the time to fire is now
}else{
ts_ = firetime()
printf("\t\tts=%g, ts_=%g\n", ts, ts_)
ts = ts_
net_move(ts)
}
}
IF (INFO) {printf("End of Net_Receive\n")}
}