Hi,
I was wondering what the most efficient way to uninsert all distributed AND point process mechanisms is. Relatedly, is there a way to print all distributed and point process mechanisms that are currently in the entire simulation?
Thanks
Uninserting mechanisms
-
- Site Admin
- Posts: 6305
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Uninserting mechanisms
Look in the Programmer's Reference for
uninsert
allobjectvars
ismembrane
If it's all your code, you might try writing the model setup part in such a way as to keep track of this, e.g. by using SectionLists as sets to keep track of which sections have which density mechanisms (or else use forall if (ismembrane())), and Lists to save objrefs for point processes i.e. in setup instead ofdoYou can make this more automatic by using a proc, e.g.
uninsert
allobjectvars
ismembrane
If it's all your code, you might try writing the model setup part in such a way as to keep track of this, e.g. by using SectionLists as sets to keep track of which sections have which density mechanisms (or else use forall if (ismembrane())), and Lists to save objrefs for point processes i.e. in setup instead of
Code: Select all
objref stim, syn
soma stim = new IClamp(0.5)
dend syn = new ExpSyn(0.3)
Code: Select all
objref tobj, pplist
pplist = new List()
soma tobj = new IClamp(0.5)
pplist.append(tobj)
dend tobj = new ExpSyn(0.3)
pplist.append(tobj)
objref tobj // destroy reference to most recently created point process
// then to eliminate any particular point process: objref pplist.o(i)
Code: Select all
objref pplist, tobj
pplist = new List()
// call in context of a particular section
// $s1 is a string of the form ClassName(range)
proc newpp() {
sprint($s1, "tobj = new %s", $s1)
execute($s1)
pplist.append(tobj)
objref tobj
}
soma newpp("IClamp(0.5)")
dend newpp("ExpSyn(0.3)")
// verify that it happened
for i=0,pplist.count()-1 print i, pplist.o(i)
-
- Site Admin
- Posts: 6305
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Uninserting mechanisms
You're welcome.