ca.nengo.util.impl
Class LearningTask
java.lang.Object
ca.nengo.util.impl.LearningTask
- All Implemented Interfaces:
- Resettable, ThreadTask, java.lang.Cloneable
public class LearningTask
- extends java.lang.Object
- implements ThreadTask
Implementation of a ThreadTask to multithread learning in a plastic ensemble.
This task will seperate the learning calculations such as getDerivative into indepdent
threadable tasks.
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LearningTask
public LearningTask(PlasticEnsembleImpl parent,
PlasticEnsembleTermination termination,
int start,
int end)
- Parameters:
parent - Parent PlasticEnsemble of this tasktermination - PlasticEnsembleTermination that this task will learn onstart - Starting index for the set of terminations to learn onend - Ending index for the set of terminations to learn on
LearningTask
public LearningTask(LearningTask copy,
int start,
int end)
- Parameters:
copy - LearningTask to copy the parent and termination values fromstart - Starting index for the set of terminations to learn onend - Ending index for the set of terminations to learn on
reset
public void reset(boolean randomize)
- Specified by:
reset in interface Resettable
- 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)
getParent
public PlasticEnsembleImpl getParent()
- See Also:
ca.nengo.util.ThreadTask#getParent()
isFinished
public boolean isFinished()
- Specified by:
isFinished in interface ThreadTask
- Returns:
- If the task has finished running
- See Also:
ThreadTask.isFinished()
run
public void run(float startTime,
float endTime)
throws SimulationException
- Description copied from interface:
ThreadTask
- Runs the Task, updating the parent Node as needed
- Specified by:
run in interface ThreadTask
- 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:
ThreadTask.run(float, float)
clone
public LearningTask clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone in interface ThreadTask- Overrides:
clone in class java.lang.Object
- Returns:
- An independent copy of the Task
- Throws:
java.lang.CloneNotSupportedException - if the superclass does not support cloning