Net_connect(t) and the variable x - is it a neuron variable?

NMODL and the Channel Builder.
Post Reply
sangrey123

Net_connect(t) and the variable x - is it a neuron variable?

Post by sangrey123 »

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:

Code: Select all

w = 0
del = 0
thresh = 0
NCelem = new NetCon(MFaff[0], GCsynapses[0], thresh, del, w)
Here is the spike generator:

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
        }
}
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Mainen and Destexhes' spike generator
Is it really theirs? or something that somebody else implemented in order to replicate a
model they published? I don't believe they ever used the event delivery system in any of
the models on which they collaborated.

The mechanism as written is buggy. In the absence of "randomness" (i.e. when "noise"
is 0), it does not produce the same results on each run in the same session. This is
because "event" is allowed to carry its value over from the end of one run to the start of
the next. Fix this by inserting
event = 0
in the INITIAL block prior to the first event_time() call.

There also seems to be something wrong with the way "delay" contributes to "interval".
Are you sure that you want "delay" to affect "interval" only if noise!=0, and do you want
its effect to be proportional to the value of "noise"?

WRT your question about x, there is nothing special about it (except that it shouldn't
also be used as the argument in the INITIAL block's call to set_seed(), just in case that
line is ever uncommented and compiled). After the "event initialization bug" is fixed, when
"noise" is 0 this mechanism produces identical results on each run regardless of what
the "x" variable is called.
Post Reply