76 lines
1.3 KiB
Modula-2
76 lines
1.3 KiB
Modula-2
COMMENT
|
|
This mod file is based on netstim.mod in NEURON
|
|
modified by Yarmo Mackenbach to relay spike times provided by the hoc script
|
|
ENDCOMMENT
|
|
|
|
NEURON {
|
|
POINT_PROCESS RelayStim
|
|
RANGE x, timeToNextEvt, refrac
|
|
}
|
|
|
|
PARAMETER {
|
|
timeToNextEvt = 10 (ms) <1e-9,1e9> : time until next spiketime (ms)
|
|
refrac = 0.1 (ms) <0,3> : absolute refractory period (ms)
|
|
}
|
|
|
|
ASSIGNED {
|
|
x : unknown significance
|
|
on : is spike generation active?
|
|
}
|
|
|
|
PROCEDURE seed(x) {
|
|
set_seed(x)
|
|
}
|
|
|
|
INITIAL {
|
|
: init variables
|
|
x = 0
|
|
on = 0
|
|
|
|
: wait until first event
|
|
net_send(timeToNextEvt, 3)
|
|
}
|
|
|
|
NET_RECEIVE(w) {
|
|
: MAIN CALL
|
|
if (flag == 1 && on == 1) {
|
|
: because somehow this is a crucial step
|
|
x = 1
|
|
|
|
: output event to synapse
|
|
net_event(t)
|
|
|
|
: disable spike generation if timeToNextEvt is null
|
|
if (timeToNextEvt == 0) {
|
|
on = 0
|
|
}
|
|
|
|
: if spike generation is turned on
|
|
if (on == 1) {
|
|
: wait until next event
|
|
net_send(timeToNextEvt, 1)
|
|
}
|
|
|
|
: refractory period call (somehow required)
|
|
net_send(refrac, 2)
|
|
}
|
|
|
|
: REFRACTORY PERIOD CALL (END OF REFRACTORY PERIOD)
|
|
if (flag == 2) {
|
|
: unknown signifance (but a required step)
|
|
x = 0
|
|
}
|
|
|
|
: INITIAL CALL
|
|
if (flag == 3) {
|
|
: if spike generation is not yet turned on
|
|
if (on == 0) {
|
|
: turn on spike generation
|
|
on = 1
|
|
|
|
: call net_receive directly
|
|
net_send(0, 1)
|
|
}
|
|
}
|
|
}
|