public class PlasticEnsembleImpl extends EnsembleImpl implements TaskSpawner
An extension of the default ensemble; connection weights can be modified by a plasticity rule.
TODO: testVisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,PlasticEnsembleTermination> |
myPlasticEnsembleTerminations |
myExpandableNodes, myExpandedTerminations
Constructor and Description |
---|
PlasticEnsembleImpl(java.lang.String name,
Node[] nodes) |
PlasticEnsembleImpl(java.lang.String name,
NodeFactory factory,
int n) |
Modifier and Type | Method and Description |
---|---|
void |
addTasks(ThreadTask[] tasks) |
PlasticEnsembleImpl |
clone() |
boolean |
getLearning() |
float |
getPlasticityInterval() |
ThreadTask[] |
getTasks() |
Termination |
getTermination(java.lang.String name) |
Termination[] |
getTerminations() |
protected static boolean |
isPopulationPlastic(Termination[] terminations) |
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 |
setStates(float endTime) |
void |
setTasks(ThreadTask[] tasks) |
addTermination, addTermination, getChildren, getDimension, notifyAboutDeletion, removeTermination, setMode, toScript
addChangeListener, collectSpikes, findCommon1DOrigins, fireVisibleChangeEvent, getCollectSpikesRatio, getDocumentation, getHistory, getMetadata, getMode, getName, getNodes, getOrigin, getOrigins, getSpikePattern, isCollectingSpikes, listStates, redefineNodes, removeChangeListener, removeOrigin, setCollectSpikesRatio, setDocumentation, setMetadata, setName, setSpikePattern, stopProbing
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDocumentation, getName, getOrigin, getOrigins, setDocumentation, setName
getMode
addChangeListener, removeChangeListener
protected java.util.Map<java.lang.String,PlasticEnsembleTermination> myPlasticEnsembleTerminations
public PlasticEnsembleImpl(java.lang.String name, Node[] nodes) throws StructuralException
name
- Name of Ensemblenodes
- Nodes that make up the EnsembleStructuralException
- if the given Nodes contain Terminations with the same
name but different dimensionspublic PlasticEnsembleImpl(java.lang.String name, NodeFactory factory, int n) throws StructuralException
StructuralException
public boolean getLearning()
public void setLearning(boolean learning)
protected static boolean isPopulationPlastic(Termination[] terminations)
public void setPlasticityInterval(float time)
public float getPlasticityInterval()
public void run(float startTime, float endTime) throws SimulationException
AbstractEnsemble
run
in interface Node
run
in class AbstractEnsemble
startTime
- simulation time at which running starts (s)endTime
- simulation time at which running ends (s)SimulationException
- if a problem is encountered while trying to runNode.run(float, float)
public void setStates(float endTime) throws SimulationException
SimulationException
public void reset(boolean randomize)
AbstractEnsemble
reset
in interface Resettable
reset
in class EnsembleImpl
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.Resettable.reset(boolean)
public ThreadTask[] getTasks()
getTasks
in interface TaskSpawner
TaskSpawner.getTasks()
public Termination getTermination(java.lang.String name) throws StructuralException
getTermination
in interface Node
getTermination
in class EnsembleImpl
name
- Name of a Termination onto this NodeStructuralException
- if the named Termination does not existNode.getTermination(java.lang.String)
public Termination[] getTerminations()
getTerminations
in interface Node
getTerminations
in class EnsembleImpl
Node.getTerminations()
public void addTasks(ThreadTask[] tasks)
addTasks
in interface TaskSpawner
tasks
- Adds the this to the tasks of the spawnerTaskSpawner.addTasks(ca.nengo.util.ThreadTask[])
public void setTasks(ThreadTask[] tasks)
setTasks
in interface TaskSpawner
tasks
- Sets the tasks of the spawner to thisTaskSpawner.setTasks(ca.nengo.util.ThreadTask[])
public PlasticEnsembleImpl clone() throws java.lang.CloneNotSupportedException
clone
in interface ExpandableNode
clone
in interface Node
clone
in class EnsembleImpl
java.lang.CloneNotSupportedException
- if clone can't be made