ca.nengo.model.impl
Class EnsembleImpl
java.lang.Object
ca.nengo.model.impl.AbstractEnsemble
ca.nengo.model.impl.EnsembleImpl
- All Implemented Interfaces:
- Ensemble, ExpandableNode, Node, Probeable, Resettable, SimulationMode.ModeConfigurable, VisiblyMutable, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- PlasticEnsembleImpl
public class EnsembleImpl
- extends AbstractEnsemble
- implements ExpandableNode
Default implementation of Ensemble.
Origins or Terminations can be set up on Nodes before they are grouped into an
Ensemble. After Nodes are added to an Ensemble, no Origins or Terminations should
be added to them directly. Terminations can be added with EnsembleImpl.addTermination(...)
If a Termination is added directly to a Node after the Node is added to the
Ensemble, the Termination will not appear in Ensemble.getTerminations()
TODO: test
- Author:
- Bryan Tripp
- See Also:
- Serialized Form
Methods inherited from class ca.nengo.model.impl.AbstractEnsemble |
addChangeListener, collectSpikes, findCommon1DOrigins, fireVisibleChangeEvent, getCollectSpikesRatio, getDocumentation, getHistory, getMode, getName, getNodes, getOrigin, getOrigins, getSpikePattern, isCollectingSpikes, listStates, redefineNodes, removeChangeListener, reset, run, setCollectSpikesRatio, setDocumentation, setName, setSpikePattern |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myExpandableNodes
protected ExpandableNode[] myExpandableNodes
myExpandedTerminations
protected java.util.Map<java.lang.String,Termination> myExpandedTerminations
OrderedTerminations
protected java.util.LinkedList<Termination> OrderedTerminations
EnsembleImpl
public EnsembleImpl(java.lang.String name,
Node[] nodes)
throws StructuralException
- Parameters:
name
- Name of Ensemblenodes
- Nodes that make up the Ensemble
- Throws:
StructuralException
- if the given Nodes contain Terminations with the same
name but different dimensions
EnsembleImpl
public EnsembleImpl(java.lang.String name,
NodeFactory factory,
int n)
throws StructuralException
- Throws:
StructuralException
getTerminations
public Termination[] getTerminations()
- Specified by:
getTerminations
in interface Node
- Overrides:
getTerminations
in class AbstractEnsemble
- Returns:
- Sets of input channels (these have the same dimension as corresponding Origins
to which they are connected).
- See Also:
Node.getTerminations()
setMode
public void setMode(SimulationMode mode)
- This Ensemble does not support SimulationMode.DIRECT.
- Specified by:
setMode
in interface SimulationMode.ModeConfigurable
- Overrides:
setMode
in class AbstractEnsemble
- Parameters:
mode
- SimulationMode in which it is desired that the object runs.- See Also:
SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)
addTermination
public Termination addTermination(java.lang.String name,
float[][] weights,
float tauPSC,
boolean modulatory)
throws StructuralException
- Description copied from interface:
ExpandableNode
- Adds a new Termination onto this Node.
- Specified by:
addTermination
in interface ExpandableNode
- Parameters:
weights
- Each row is used as a 1 by m matrix of weights in a new termination on the nth expandable nodename
- Unique name for the Termination (in the scope of this Node)tauPSC
- Time constant with which incoming signals are filtered. (All Terminations have
this property, but it may have slightly different interpretations per implementation.)modulatory
- If true, inputs to the Termination are not summed with other inputs (they
only have modulatory effects, eg on plasticity, which must be defined elsewhere).
- Returns:
- resulting Termination
- Throws:
StructuralException
- if length of weights doesn't equal getDimension(),
or if there are different numbers of weights given in different rows.- See Also:
ExpandableNode.addTermination(java.lang.String, float[][], float, boolean)
removeTermination
public void removeTermination(java.lang.String name)
throws StructuralException
- Specified by:
removeTermination
in interface ExpandableNode
- Parameters:
name
- Name of Termination to remove.
- Throws:
StructuralException
- See Also:
ExpandableNode.removeTermination(java.lang.String)
getDimension
public int getDimension()
- Specified by:
getDimension
in interface ExpandableNode
- Returns:
- Output dimension of Terminations onto this Node
- See Also:
ExpandableNode.getDimension()
getTermination
public Termination getTermination(java.lang.String name)
throws StructuralException
- Specified by:
getTermination
in interface Node
- Overrides:
getTermination
in class AbstractEnsemble
- Parameters:
name
- Name of a Termination onto this Node
- Returns:
- The named Termination if it exists
- Throws:
StructuralException
- if the named Termination does not exist- See Also:
Node.getTermination(java.lang.String)
clone
public Ensemble clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface Node
- Overrides:
clone
in class AbstractEnsemble
- Returns:
- An independent copy of the Node
- Throws:
java.lang.CloneNotSupportedException