Accessing functions in a cell template with a NetStim
Posted: Tue Jul 23, 2013 1:59 pm
Hi, I have an artificial cell template that contains a NetStim. I added an "is_art" function to this cell template, but when I try to access it from the parallel context, NEURON is looking for it to be part of the NetStim within the cell template, instead of just a function available as part of the cell instance. Here is my cell definition:
Then I create an instance of this cell template, and is_art works fine. But when I associate the cell with a gid and then try to recreate the cell object from the gid using the parallel context, is_art no longer works:
Do I need to edit "MyNetStim" and create an is_art function in there or is there a way I can make the pc.gid2cell generated object's functions available?
Code: Select all
begintemplate ppspont
public pp, is_art, acell, connect_pre
create acell
objref pp
proc init() {
actemp()
}
proc actemp() {
acell pp = new MyNetStim(.5)
}
func is_art() {return 1}
proc connect_pre() {acell $o2 = new NetCon(pp, $o1)}
endtemplate ppspont
Code: Select all
{load_file("nrngui.hoc")}
{load_file("netparmpi.hoc")}
ncell=1
objref pnm, pc, nc, nil
proc parallelizer() {
pnm = new ParallelNetManager(ncell)
pc = pnm.pc
pnm.round_robin()
}
parallelizer()
pc.nhost // returns 1
objref mycell
mycell = new ppspont()
mycell.is_art() // works fine, returns 1
objref nc
mycell.connect_pre(nil, nc)
pc.cell(0, nc)
pc.gid_exists(0) // returns 1
objref thecell
thecell = pc.gid2cell(0)
thecell.is_art() // errors out with the error:
// is_art not a public member of MyNetStim
// nrniv: MyNetStim is_art