ca.nengo.model.plasticity.impl
Class PlasticEnsembleImpl
java.lang.Object
ca.nengo.model.impl.AbstractEnsemble
ca.nengo.model.impl.EnsembleImpl
ca.nengo.model.plasticity.impl.PlasticEnsembleImpl
- All Implemented Interfaces:
- Ensemble, ExpandableNode, Node, Probeable, Resettable, SimulationMode.ModeConfigurable, TaskSpawner, VisiblyMutable, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- DecodableEnsembleImpl
public class PlasticEnsembleImpl
- extends EnsembleImpl
- implements TaskSpawner
An extension of the default ensemble; connection weights can be modified
by a plasticity rule.
TODO: test
- 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, removeOrigin, setCollectSpikesRatio, setDocumentation, setName, setSpikePattern, stopProbing |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myPlasticEnsembleTerminations
protected java.util.Map<java.lang.String,PlasticEnsembleTermination> myPlasticEnsembleTerminations
PlasticEnsembleImpl
public PlasticEnsembleImpl(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
PlasticEnsembleImpl
public PlasticEnsembleImpl(java.lang.String name,
NodeFactory factory,
int n)
throws StructuralException
- Throws:
StructuralException
getLearning
public boolean getLearning()
setLearning
public void setLearning(boolean learning)
isPopulationPlastic
protected static boolean isPopulationPlastic(Termination[] terminations)
setPlasticityInterval
public void setPlasticityInterval(float time)
- See Also:
PlasticEnsemble.setPlasticityInterval(float)
getPlasticityInterval
public float getPlasticityInterval()
- See Also:
PlasticEnsemble.getPlasticityInterval()
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)
setStates
public void setStates(float endTime)
throws SimulationException
- Throws:
SimulationException
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 EnsembleImpl
- 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)
getTasks
public ThreadTask[] getTasks()
- Specified by:
getTasks
in interface TaskSpawner
- Returns:
- The ThreadTasks used by this Node
- See Also:
TaskSpawner.getTasks()
getTermination
public Termination getTermination(java.lang.String name)
throws StructuralException
- Specified by:
getTermination
in interface Node
- Overrides:
getTermination
in class EnsembleImpl
- 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)
getTerminations
public Termination[] getTerminations()
- Specified by:
getTerminations
in interface Node
- Overrides:
getTerminations
in class EnsembleImpl
- Returns:
- Sets of input channels (these have the same dimension as corresponding Origins
to which they are connected).
- See Also:
Node.getTerminations()
addTasks
public void addTasks(ThreadTask[] tasks)
- Specified by:
addTasks
in interface TaskSpawner
- Parameters:
tasks
- Adds the this to the tasks of the spawner- See Also:
TaskSpawner.addTasks(ca.nengo.util.ThreadTask[])
setTasks
public void setTasks(ThreadTask[] tasks)
- Specified by:
setTasks
in interface TaskSpawner
- Parameters:
tasks
- Sets the tasks of the spawner to this- See Also:
TaskSpawner.setTasks(ca.nengo.util.ThreadTask[])
clone
public PlasticEnsembleImpl clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface ExpandableNode
- Specified by:
clone
in interface Node
- Overrides:
clone
in class EnsembleImpl
- Returns:
- An independent copy of the Node
- Throws:
java.lang.CloneNotSupportedException
- if clone can't be made