Code: Select all
begintemplate cell
public soma, connect2target....
proc init() {
...
}
obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
soma nc = new NetCon(&v(1), $o1)
nc.threshold = 0
if (numarg() == 2) { $o2 = nc } // for backward compatibility
return nc
}
endtemplate cell
begintemplate autapse
public callAutapse
objref tempsyn
proc init() {
objref tempsyn
$o1.soma tempsyn = new ExpSyn(0.5)
tempsyn.e = -75
tempsyn.tau = 6
}
obfunc callAutapse() {
return tempsyn
}
endtemplate autapse
objref cl
cl = new List()
for i = 0, ncells-1 {
cl.append(new cell())
}
objref autlist, autsyn
autlist = new List()
autsyn = new List()
proc MakeAutapses() { localobj asyn, a, aindex
for n = 0, ncells-1 {
a = new autapse(cl.o(n))
aindex = a.callAutapse()
autlist.append(aindex)
asyn = cl.o(n).connect2target(aindex)
asyn.weight = 0.02
asyn.delay = 2
autsyn.append(asyn)
}
}