Nengo.ca

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).

See Also:
Serialized Form

Constructor Summary
EnsembleOrigin(Node node, java.lang.String name, Origin[] nodeOrigins)
           
 
Method Summary
 EnsembleOrigin clone()
          Note: the clone references the same copies of the underlying node origins.
 EnsembleOrigin clone(Ensemble ensemble)
          Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.
 int getDimensions()
           
 java.lang.String getName()
           
 Node getNode()
           
 boolean getRequiredOnCPU()
           
 InstantaneousOutput getValues()
           
 void setRequiredOnCPU(boolean val)
           
 void setValues(InstantaneousOutput values)
           
 
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()

setValues

public void setValues(InstantaneousOutput values)
Specified by:
setValues in interface Origin

setRequiredOnCPU

public void setRequiredOnCPU(boolean val)
Specified by:
setRequiredOnCPU in interface Origin

getRequiredOnCPU

public boolean getRequiredOnCPU()
Specified by:
getRequiredOnCPU in interface Origin

getNode

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

clone

public EnsembleOrigin 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
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - if clone cannot be made

clone

public EnsembleOrigin clone(Ensemble ensemble)
                     throws java.lang.CloneNotSupportedException
Description copied from interface: Origin
Clone method that changes necessary parameters to point to a new parent, for use in cloning ensembles, etc.

Specified by:
clone in interface Origin
Parameters:
ensemble - New parent ensemble
Returns:
A clone of the origin for the new parent ensemble
Throws:
java.lang.CloneNotSupportedException - if clone cannot be made

Nengo.ca