ca.nengo.model.impl
Class EnsembleOrigin

java.lang.Object
  extended by ca.nengo.model.impl.EnsembleOrigin
All Implemented Interfaces:
Origin, java.io.Serializable, java.lang.Cloneable

public class EnsembleOrigin
extends java.lang.Object
implements Origin

An Origin that is composed of the Origins of multiple Nodes. The dimension of this Origin equals the number of Nodes. All the Nodes must produce the same type of output (RealOutput or SpikeOutput) with the same Unit at the same time (these things can change in subsequent time steps, but they must change together for all Nodes).

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
EnsembleOrigin(Node node, java.lang.String name, Origin[] nodeOrigins)
           
 
Method Summary
 Origin clone()
          Note: the clone references the same copies of the underlying node origins.
 int getDimensions()
           
 java.lang.String getName()
           
 Node getNode()
           
 InstantaneousOutput getValues()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnsembleOrigin

public EnsembleOrigin(Node node,
                      java.lang.String name,
                      Origin[] nodeOrigins)
Parameters:
node - The parent Node
name - Name of this Origin
nodeOrigins - Origins on individual Nodes that are combined to make this Origin. Each of these is expected to have dimension 1, but this is not enforced. Other dimensions are ignored.
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Origin
Returns:
Name of this Origin (unique in the scope of a source of Origins, eg a Neuron or Ensemble)
See Also:
Origin.getName()

getDimensions

public int getDimensions()
Specified by:
getDimensions in interface Origin
Returns:
Dimensionality of information coming from this Origin (eg number of axons, or dimension of decoded function of variables represented by the Ensemble)
See Also:
Origin.getDimensions()

getValues

public InstantaneousOutput getValues()
                              throws SimulationException
Specified by:
getValues in interface Origin
Returns:
A composite of the first-dimensional outputs of all the Node Origins that make up the EnsembleOrigin. Node Origins should normally have dimension 1, but this isn't enforced here. All Node Origins must have the same units, and must output the same type of InstantaneousOuput (ie either SpikeOutput or RealOutput), otherwise an exception is thrown.
Throws:
SimulationException - if there is any problem retrieving values
See Also:
Origin.getValues()

getNode

public Node getNode()
Specified by:
getNode in interface Origin
Returns:
The Node to which the Origin belongs
See Also:
Origin.getNode()

clone

public Origin clone()
             throws java.lang.CloneNotSupportedException
Note: the clone references the same copies of the underlying node origins. This will work if the intent is to duplicate an EnsembleOrigin on the same Ensemble. More work is needed if this clone is part of an Ensemble clone, since the cloned EnsembleOrigin should then reference the new node origins, which we don't have access to here.

Specified by:
clone in interface Origin
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException