OK, i found out what you meant, it deals with WATCH(), for threshold detection within the POINTPROCESS, and net_send() function to dialog with the NetCon object.
Hence, i have the following, with a reduced test model :
the hoc instantiates one ns POINTPROCESS in PRE, one nr POINTPROCESS in POST, and one NetCon object :
Code: Select all
load_file("nrngui.hoc")
objref cvode
cvode = new CVode(1)
cvode_active(1)
create PRE
objref ns
ns = new myns(.5)
create POST
objref nr
nr = new mynr(.5)
objref nc
nc = new NetCon(ns,nr,1,0,ns.w)
myns POINTPROCESS implements a WATCH element, and generate net_event(t) events at appropriate times :
Code: Select all
NEURON {POINT_PROCESS myns
RANGE w}
STATE {XX}
INITIAL {
XX = 0.0
net_send(0,1)
}
PARAMETER{
w = 2.0
}
BREAKPOINT {
SOLVE states METHOD derivimplicit
}
DERIVATIVE states{
XX' = (1.1-XX)/10.0
}
NET_RECEIVE(w){
if (flag == 1){
WATCH(XX>1.0) 2
}
if(flag == 2){
net_event(t)
XX = 0.0
}
}
And mynr object is basically an exp2syn object, implementing a NET_RECEIVE block :
Code: Select all
NEURON {
POINT_PROCESS mynr
RANGE tau1, tau2, e, i
NONSPECIFIC_CURRENT i
RANGE g
}
UNITS {
(nA) = (nanoamp)
(mV) = (millivolt)
(uS) = (microsiemens)
}
PARAMETER {
tau1=.1 (ms) <1e-9,1e9>
tau2 = 10 (ms) <1e-9,1e9>
e=0 (mV)
}
ASSIGNED {
v (mV)
i (nA)
g (uS)
factor
}
STATE {
A (uS)
B (uS)
}
INITIAL {
LOCAL tp
if (tau1/tau2 > .9999) {
tau1 = .9999*tau2
}
A = 0
B = 0
tp = (tau1*tau2)/(tau2 - tau1) * log(tau2/tau1)
factor = -exp(-tp/tau1) + exp(-tp/tau2)
factor = 1/factor
}
BREAKPOINT {
SOLVE state METHOD cnexp
g = B - A
i = g*(v - e)
}
DERIVATIVE state {
A' = -A/tau1
B' = -B/tau2
}
NET_RECEIVE(weight (uS)) {
A = A + weight*factor
B = B + weight*factor
}
Nice, thanks !