Nengo.ca

ca.nengo.util.impl
Class LearningTask

java.lang.Object
  extended by 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.


Constructor Summary
LearningTask(LearningTask copy, int start, int end)
           
LearningTask(PlasticEnsembleImpl parent, PlasticEnsembleTermination termination, int start, int end)
           
 
Method Summary
 LearningTask clone()
           
 LearningTask clone(PlasticEnsembleImpl parent)
           
 LearningTask clone(PlasticEnsembleImpl parent, PlasticEnsembleTermination term)
           
 PlasticEnsembleImpl getParent()
           
 boolean isFinished()
           
 void reset(boolean randomize)
           
 void run(float startTime, float endTime)
          Runs the Task, updating the parent Node as needed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LearningTask

public LearningTask(PlasticEnsembleImpl parent,
                    PlasticEnsembleTermination termination,
                    int start,
                    int end)
Parameters:
parent - Parent PlasticEnsemble of this task
termination - PlasticEnsembleTermination that this task will learn on
start - Starting index for the set of terminations to learn on
end - 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 from
start - Starting index for the set of terminations to learn on
end - Ending index for the set of terminations to learn on
Method Detail

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

clone

public LearningTask clone(PlasticEnsembleImpl parent)
                   throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

clone

public LearningTask clone(PlasticEnsembleImpl parent,
                          PlasticEnsembleTermination term)
                   throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

Nengo.ca