classes
action is_artificial pp_begin selected
count is_netcon_target pp_next
has_net_event make remove
internal_type menu select
SYNTAX
mt = new MechanismType(0)
mt = new MechanismType(1)
DESCRIPTION
Provides a way of iterating over all membrane mechanisms or point
processes and allows selection via a menu or under hoc control.
The 0 argument creates a list of all available distributed
membrane mechanisms (as opposed to PointProcesses). eg "hh", "pas", "extracellular". that can
be inserted into a section.
The 1 argument creates a
list of all available Point Processes.
eg. IClamp, AlphaSynapse, VClamp.
Mechanism order is the same as the argument order that created the "special"
during nrnivmodl
or mknrndll
. Therefore when a saved session depends
on information in a MechanismType
it is dependent on a particular special
or dll.
EXAMPLES
execute following example
objref mt
//Print the names of all density mechanisms
mt = new MechanismType(0)
strdef mname
for i=0, mt.count()-1 {
mt.select(i)
mt.selected(mname)
print mname
}
SEE ALSO
MechanismStandard
MechanismType
SYNTAX
mt.select("name")
mt.select(i)
DESCRIPTION
selects either the named mechanism or the i'th mechanism in the list.
MechanismType
SYNTAX
i = mt.selected([strdef])
DESCRIPTION
returns the index of the current selection. If present, strarg is assigned
to the name of the current selection.
MechanismType
SYNTAX
mt.remove()
DESCRIPTION
For distributed mechanisms invoked with the "insert" statement.
Deletes selected mechanism from currently
accessed section. A nop if the mechanism is not in the section.
MechanismType
SYNTAX
mt.make()
mt.make(objectvar)
DESCRIPTION
-
mt.make()
- For distributed mechanisms. Inserts selected mechanism into currently
accessed section.
-
mt.make(objectvar)
- For point processes. The arg becomes a reference to a new point process
of type given by the selection.
Note that the newly created point process is not located in any section.
Note that if objectvar was the only reference to another object then
that object is destroyed.
MechanismType
SYNTAX
i = mt.count()
DESCRIPTION
The number of different mechanisms in the list.
MechanismType
SYNTAX
mt.menu()
DESCRIPTION
Inserts a special menu into the currently open xpanel
. The menu
label always reflects the current selection. Submenu items are indexed
according to position with the first item being item 0. When the mouse
button is released on a submenu item that item becomes the selection
and the action (if any) is executed.
MechanismType
SYNTAX
mt.action("command")
DESCRIPTION
The action to be executed when a submenu item is selected.
MechanismType
SYNTAX
boolean = mt.is_netcon_target(i)
DESCRIPTION
The i'th point process has a NET_RECEIVE block and can therefore be
a target for a NetCon object.
MechanismType
SYNTAX
boolean = mt.has_net_event(i)
DESCRIPTION
The i'th point process has a net_event call in its NET_RECEIVE block
and can therefore be a source for a NetCon object.
This means it is NetCon stimulator or that
the point process can be used as an artificial neural network cell.
MechanismType
SYNTAX
boolean = mt.is_artificial(i)
DESCRIPTION
The i'th point process is an ARTIFICIAL_CELL
and can therefore be a source for a NetCon object.
This means it is NetCon stimulator or that
the point process can be used as an artificial neural network cell.
This seems to have, but does not, equivalent functionality to
has_net_event and was introduced because ARTIFICIAL_CELL objects are no
longer located in sections. Some ARTIFICIAL_CELLs such as the PatternStim
do not make use of net_event in their implementation, and some PointProcesses
do use net_event and must be located in sections for their proper function,
e.g. reciprocal synapses.
MechanismType
SYNTAX
obj = mt.pp_begin()
DESCRIPTION
Initializes an iterator used to iterate over point processes of
a particular type in the currently accessed section.
Returns the first point process in the currently accessed
section having the type specified by the select
statement. This only works if the the MechanismType was instantiated
with the (1) argument. If there is no such point process in the
section the method returns NULLobject. Note that, prior to version
6.2, although
the x=1 node is normally
considered to be part of the section, the parent node
was not looked at (normally x = 0) unless the section was the
root of the tree. As of version 6.2, both the 0 and 1 locations
are looked at and if the point process used the section to locate
it, then it is returned. If the point process used the child or
parent section to locate it, it is not returned.
EXAMPLES
execute following example
create cable
access cable
nseg = 5
objref stim[3]
for i=0,2 stim[i] = new IClamp(i/2)
objref mt, pp
mt = new MechanismType(1)
mt.select("IClamp")
for (pp = mt.pp_begin(); object_id(pp) != 0; pp = mt.pp_next()) {
x = pp.get_loc()
printf("%s located at %s(%g)\n", pp, secname(), x)
pop_section()
}
MechanismType
SYNTAX
obj = mt.pp_next()
DESCRIPTION
Returns the next point process of the type and in the section that
were specified in the earlier call to pp_begin .
When there are no more point processes, the return value is NULLobject.
MechanismType
SYNTAX
internal_type = mt.internal_type()
DESCRIPTION
Return the internal type index of the selected mechanism.
neuron/neuron/classes/mechtype.hel : May 13 2012