Net_connect(t) and the variable x - is it a neuron variable?
Posted: Wed Jun 11, 2008 6:52 am
I have pared down Mainen and Destexhes' spike generator and noticed that there is something special about the use of the variable "x" when keeping track of the presynaptic state. The generator works fine if I use a net_event(t) statement only and it also works if I toggle the variable "x" at each event_time() in order to signal an event. However, if I use a different variable name such as "a", then this toggling method fails. Is there something neuron specific about x within a NET_RECEIVE block?
Here is the hoc code that connects the generator (MFaff[0]) to a target:
Here is the spike generator:
Here is the hoc code that connects the generator (MFaff[0]) to a target:
Code: Select all
w = 0
del = 0
thresh = 0
NCelem = new NetCon(MFaff[0], GCsynapses[0], thresh, del, w)Code: Select all
NEURON {
POINT_PROCESS MF
RANGE x, ton, toff, delay, meanISI, noise
}
PARAMETER {
ton = 50 (ms) : start of first interburst interval
toff = 1e10 (ms) : time to stop bursting
noise = 0 : amount of randomeaness (0.0 - 1.0)
delay = 4 (ms)
meanISI = 25 (ms)
}
ASSIGNED {
x
event (ms)
on
}
PROCEDURE seed(x) {
set_seed(x)
}
INITIAL {
on = 1
x = -90
event_time()
while (on == 1 && event < 0) {
event_time()
}
if (on == 1) {
net_send(event, 1)
: seed(x)
}
}
FUNCTION interval(mean (ms)) (ms) {
if (mean <= 0.1) {
mean = .01 (ms)
}
if (noise == 0) {
interval = mean
}else{
interval = (1. - noise)*mean + noise*(mean*exprand(1)+delay) : $
}
}
PROCEDURE event_time() {
event = event + interval(meanISI)
if (event > toff || event < ton) {
on = 0
}
}
NET_RECEIVE (w) {
:printf("Pregen receive t=%g flag=%g\n", t, flag)
if (flag == 1 && on == 1) {
x = 20
: net_event(t)
event_time()
net_send(event - t, 1)
net_send(.1, 2)
}
if (flag == 2) {
x = -90
}
}