ca.nengo.model.impl
Class PlasticEnsembleImpl

java.lang.Object
  extended by ca.nengo.model.impl.AbstractEnsemble
      extended by ca.nengo.model.impl.EnsembleImpl
          extended by ca.nengo.model.impl.PlasticEnsembleImpl
All Implemented Interfaces:
Ensemble, ExpandableNode, Node, Probeable, Resettable, SimulationMode.ModeConfigurable, VisiblyMutable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DecodableEnsembleImpl

public class PlasticEnsembleImpl
extends EnsembleImpl

An extension of the default ensemble; connection weights can be modified by a plasticity rule.

TODO: test

Author:
Trevor Bekolay
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
 
Field Summary
 
Fields inherited from class ca.nengo.model.impl.EnsembleImpl
myExpandableNodes, myExpandedTerminations, OrderedTerminations
 
Fields inherited from class ca.nengo.model.impl.AbstractEnsemble
myNodes, myTerminations
 
Constructor Summary
PlasticEnsembleImpl(java.lang.String name, Node[] nodes)
           
PlasticEnsembleImpl(java.lang.String name, NodeFactory factory, int n)
           
 
Method Summary
 Termination addTermination(java.lang.String name, float[][] weights, float tauPSC, boolean modulatory)
          Adds a new Termination onto this Node.
 Ensemble clone()
           
 float getPlasticityInterval()
           
 PlasticityRule getPlasticityRule(java.lang.String terminationName)
           
 void reset(boolean randomize)
          Resets each Node in this Ensemble.
 void run(float startTime, float endTime)
          Runs each neuron in the Ensemble.
 void setLearning(boolean learning)
           
 void setPlasticityInterval(float time)
           
 void setPlasticityRule(java.lang.String terminationName, PlasticityRule rule)
          Sets the given plasticity rule for this Ensemble.
 
Methods inherited from class ca.nengo.model.impl.EnsembleImpl
getDimension, getTermination, getTerminations, removeTermination, setMode
 
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, setCollectSpikesRatio, setDocumentation, setName, setSpikePattern
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.nengo.model.Node
getDocumentation, getName, getOrigin, getOrigins, setDocumentation, setName
 
Methods inherited from interface ca.nengo.model.SimulationMode.ModeConfigurable
getMode
 
Methods inherited from interface ca.nengo.util.VisiblyMutable
addChangeListener, removeChangeListener
 

Constructor Detail

PlasticEnsembleImpl

public PlasticEnsembleImpl(java.lang.String name,
                           Node[] nodes)
                    throws StructuralException
Parameters:
name - Name of Ensemble
nodes - Nodes that make up the Ensemble
Throws:
StructuralException - if the given Nodes contain Terminations with the same name but different dimensions

PlasticEnsembleImpl

public PlasticEnsembleImpl(java.lang.String name,
                           NodeFactory factory,
                           int n)
                    throws StructuralException
Throws:
StructuralException
Method Detail

reset

public void reset(boolean randomize)
Description copied from class: AbstractEnsemble
Resets each Node in this Ensemble.

Specified by:
reset in interface Resettable
Overrides:
reset in class AbstractEnsemble
Parameters:
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.
See Also:
Resettable.reset(boolean)

setLearning

public void setLearning(boolean learning)
See Also:
Resettable.reset(boolean)

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
Overrides:
addTermination in class EnsembleImpl
Parameters:
weights - Each row is used as a 1 by m matrix of weights in a new termination on the nth expandable node
name - 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)

setPlasticityRule

public void setPlasticityRule(java.lang.String terminationName,
                              PlasticityRule rule)
                       throws StructuralException
Sets the given plasticity rule for this Ensemble. Termination must be plastic.

Throws:
StructuralException
See Also:
PlasticEnsemble.setPlasticityRule(java.lang.String, ca.nengo.model.plasticity.PlasticityRule)

setPlasticityInterval

public void setPlasticityInterval(float time)
See Also:
PlasticEnsemble.setPlasticityInterval(float)

getPlasticityInterval

public float getPlasticityInterval()
See Also:
PlasticEnsemble.getPlasticityInterval()

getPlasticityRule

public PlasticityRule getPlasticityRule(java.lang.String terminationName)
                                 throws StructuralException
Throws:
StructuralException
See Also:
PlasticEnsemble.getPlasticityRule(java.lang.String)

run

public void run(float startTime,
                float endTime)
         throws SimulationException
Description copied from class: AbstractEnsemble
Runs each neuron in the Ensemble.

Specified by:
run in interface Node
Overrides:
run in class AbstractEnsemble
Parameters:
startTime - simulation time at which running starts (s)
endTime - simulation time at which running ends (s)
Throws:
SimulationException - if a problem is encountered while trying to run
See Also:
Node.run(float, float)

clone

public Ensemble clone()
               throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Node
Overrides:
clone in class EnsembleImpl
Returns:
An independent copy of the Node
Throws:
java.lang.CloneNotSupportedException