classes action in panel count name save get out set
ms = new MechanismStandard("name")
ms = new MechanismStandard("name", vartype)
name is a density mechanism such as hh
or a point process
such as VClamp
. A MechanismStandard
instance, when created,
contains default values for all parameters associated with the mechanism.
In combination with the MechanismType class it is possible to create generic graphical interface widgets that are independent of the particular mechanism and parameter names.
If vartype = 1, 2, or 3, the storage is for PARAMETER, ASSIGNED, or STATE variables respectively. If vartype = 0, the storage is for all three types.
If vartype = -1, the count and names (and array size) of the GLOBAL variables are accessible, but any other method will generate an error message.
objref ms1, ms2 ms1 = new MechanismStandard("hh") ms2 = new MechanismStandard("AlphaSynapse") ms2.set("gmax", .3) ms1.panel() ms2.panel()
The following example prints all the names associated with POINT_PROCESS and SUFFIX mechanisms. execute following example
create soma access soma objref ms, mt strdef s, msname proc pname() {local i, j, k for i=-1,3 { ms = new MechanismStandard($s1, i) print "\n", $s1, " vartype=", i for j=0, ms.count()-1 { k = ms.name(s, j) print j, s, " size=", k } } } proc ptype() {local i, j for i=0,1 { mt = new MechanismType(i) for j=0, mt.count-1 { mt.select(j) mt.selected(msname) print "\n\n", msname, " mechanismtype=", j pname(msname) } } } ptype()
MechanismStandard
ms.panel()
ms.panel("string")
With no argument the first item in the panel will be the name of the mechanism. Otherwise the string is used as the first item label.
MechanismStandard
ms.action("statement")
create soma, axon, dend[3] forsec "a" insert hh forsec "d" insert pas xpanel("Updated when MechanismStandard is changed") xvalue("dend[0].g_pas") xvalue("dend[1].g_pas") xvalue("dend[2].g_pas") xpanel() objref ms ms = new MechanismStandard("pas") ms.action("change_pas()") ms.panel() proc change_pas() { forall if(ismembrane("pas")) { ms.out() } }
MechanismStandard
ms.in()
ms.in(x)
ms.in(pointprocess)
ms.in(mechanismstandard)
ms.in()
ms.in(x)
ms.in(pointprocess)
ms.in(mechanismstandard)
MechanismStandard
ms.out()
ms.out(x)
ms.out(pointprocess)
ms.out(mechanismstandard)
ms.out()
ms.out(x)
ms.out(pointprocess)
ms.out(mechanismstandard)
MechanismStandard
ms.set("varname", val [, arrayindex])
MechanismStandard
val = ms.get("varname" [, arrayindex])
MechanismStandard
.save("name")
MechanismStandard
cnt = ms.count()
MechanismStandard
ms.name(strdef)
size = ms.name(strdef, i)
When the i parameter is present (i ranges from 0 to ms.count()-1) the strdef parameter gets assigned the ith name of the mechanism represented by the MechanismStandard. In addition the return value is the array size of that parameter (1 for a scalar).