public class SkeletalMuscleImpl extends java.lang.Object implements SkeletalMuscle
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
ACTIVATION, DYNAMIC_SPINDLE_ORIGIN, EXCITATION_TERMINATION, FORCE, GTO_ORIGIN, LENGTH, STATIC_SPINDLE_ORIGIN
Constructor and Description |
---|
SkeletalMuscleImpl(java.lang.String name,
DynamicalSystem dynamics) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(VisiblyMutable.Listener listener) |
SkeletalMuscle |
clone() |
Node[] |
getChildren() |
java.lang.String |
getDocumentation() |
float |
getForce() |
TimeSeries |
getHistory(java.lang.String stateName)
Note that the units of TimeSeries' for a given state do not change over time (ie at different
time steps).
|
SimulationMode |
getMode() |
java.lang.String |
getName() |
Origin |
getOrigin(java.lang.String name) |
Origin[] |
getOrigins() |
Termination |
getTermination(java.lang.String name) |
Termination[] |
getTerminations() |
java.util.Properties |
listStates() |
void |
notifyAboutDeletion()
This method tells the Node (network) that is being deleted from Nengo,
Node can inform its children (child Nodes) that are being deleted,
these nodes can e.g.
|
void |
removeChangeListener(VisiblyMutable.Listener listener) |
void |
reset(boolean randomize) |
void |
run(float startTime,
float endTime)
Runs the Node (including all its components), updating internal state and outputs as needed.
|
void |
setDocumentation(java.lang.String text) |
void |
setLength(float length) |
void |
setMode(SimulationMode mode)
Sets the object to run in either the given mode or the closest mode that it supports
(all ModeConfigurables must support SimulationMode.DEFAULT, and must default to this mode).
|
void |
setName(java.lang.String name) |
java.lang.String |
toScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData) |
public SkeletalMuscleImpl(java.lang.String name, DynamicalSystem dynamics) throws StructuralException
name
- Muscle namedynamics
- Dynamics for the muscleStructuralException
- if dimensionality isn't 2 in, 1 outpublic SimulationMode getMode()
getMode
in interface SimulationMode.ModeConfigurable
SimulationMode.ModeConfigurable.getMode()
public void setMode(SimulationMode mode)
SimulationMode.ModeConfigurable
setMode
in interface SimulationMode.ModeConfigurable
mode
- SimulationMode in which it is desired that the object runs.SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)
public java.lang.String getName()
getName
in interface Node
Node.getName()
public void setName(java.lang.String name) throws StructuralException
setName
in interface Node
name
- The new name (must be unique within any networks of which this Node
will be a part)StructuralException
- if name already exists?public Origin getOrigin(java.lang.String name) throws StructuralException
getOrigin
in interface Node
name
- Name of an Origin on this NodeStructuralException
- if the named Origin does not existNode.getOrigin(java.lang.String)
public Origin[] getOrigins()
getOrigins
in interface Node
Node.getOrigins()
public Termination getTermination(java.lang.String name) throws StructuralException
getTermination
in interface Node
name
- Name of a Termination onto this NodeStructuralException
- if the named Termination does not existNode.getTermination(java.lang.String)
public Termination[] getTerminations()
getTerminations
in interface Node
Node.getTerminations()
public void run(float startTime, float endTime) throws SimulationException
Node
run
in interface Node
startTime
- simulation time at which running starts (s)endTime
- simulation time at which running ends (s)SimulationException
- if a problem is encountered while trying to runNode.run(float, float)
public float getForce()
getForce
in interface SkeletalMuscle
SkeletalMuscle.getForce()
public void setLength(float length)
setLength
in interface SkeletalMuscle
length
- length of the muscleSkeletalMuscle.setLength(float)
public void reset(boolean randomize)
reset
in interface Resettable
randomize
- True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.Resettable.reset(boolean)
public TimeSeries getHistory(java.lang.String stateName) throws SimulationException
Probeable
getHistory
in interface Probeable
stateName
- A state variable nameSimulationException
- if the Probeable does not have the requested stateProbeable.getHistory(java.lang.String)
public java.util.Properties listStates()
listStates
in interface Probeable
Probeable.listStates()
public java.lang.String getDocumentation()
getDocumentation
in interface Node
Node.getDocumentation()
public void setDocumentation(java.lang.String text)
setDocumentation
in interface Node
text
- New user-specified documentation for the NodeNode.setDocumentation(java.lang.String)
public void addChangeListener(VisiblyMutable.Listener listener)
addChangeListener
in interface VisiblyMutable
listener
- Listener to addVisiblyMutable.addChangeListener(ca.nengo.util.VisiblyMutable.Listener)
public void removeChangeListener(VisiblyMutable.Listener listener)
removeChangeListener
in interface VisiblyMutable
listener
- Listener to removeVisiblyMutable.removeChangeListener(ca.nengo.util.VisiblyMutable.Listener)
public SkeletalMuscle clone() throws java.lang.CloneNotSupportedException
public Node[] getChildren()
getChildren
in interface Node
public java.lang.String toScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData) throws ScriptGenException
toScript
in interface Node
scriptData
- Map of class parent and prefix data for generating python scriptScriptGenException
- if the node cannot be generated in scriptpublic void notifyAboutDeletion()
Node
notifyAboutDeletion
in interface Node