edu.memphis.ccrg.lida.pam.tasks
Class MultipleDetectionAlgorithm

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
      extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
          extended by edu.memphis.ccrg.lida.framework.shared.activation.LearnableImpl
              extended by edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl
                  extended by edu.memphis.ccrg.lida.pam.tasks.MultipleDetectionAlgorithm
All Implemented Interfaces:
FullyInitializable, Initializable, Activatible, Learnable, FrameworkTask, DetectionAlgorithm, java.util.concurrent.Callable<FrameworkTask>

public abstract class MultipleDetectionAlgorithm
extends FrameworkTaskImpl
implements DetectionAlgorithm

This class implements the FeatureDetector interface and provides default methods. Users should extend this class and overwrite the detect() and excitePam() methods. A convenience init() method is added to initialize the class. This method can be overwritten as well. This implementation is oriented to detect features from sensoryMemory, but the implementation can be used to detect and send excitation from other modules, like Workspace, emotions or internal states.

Author:
Ryan J. McCall

Field Summary
protected  PerceptualAssociativeMemory pam
          the PerceptualAssociativeMemory
protected  java.util.Map<java.lang.String,PamLinkable> pamNodeMap
          Map of PamLinkable
protected  SensoryMemory sensoryMemory
          PamLinkable this algorithm detects
 
Fields inherited from class edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl
status
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Learnable
DEFAULT_BASE_LEVEL_ACTIVATION, DEFAULT_LEARNABLE_REMOVAL_THRESHOLD
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
MultipleDetectionAlgorithm()
           
 
Method Summary
 void addPamLinkable(PamLinkable linkable)
          Adds PamLinkable.
 double detect()
          Detects a feature.
abstract  void detectLinkables()
          Override this method for domain-specific feature detection
 PamLinkable getPamLinkable()
          Returns PamLinkable this algorithm can detect.
 void init()
          This task can be initialized with the following parameters:

nodes type=stringlabels of the Nodes in PerceptualAssociativeMemory this algorithm detects
protected  void runThisFrameworkTask()
          To be overridden by extending classes.
 void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
          Subclasses may override this method.
 void setPamLinkable(PamLinkable linkable)
          Adds PamLinkable that will be detected by this algorithm.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.tasks.FrameworkTaskImpl
call, cancel, equals, getControllingTaskSpawner, getNextTicksPerRun, getScheduledTick, getTaskId, getTaskStatus, getTicksPerRun, hashCode, setControllingTaskSpawner, setNextTicksPerRun, setScheduledTick, setTaskStatus, setTicksPerRun, stopRunning, toString
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.LearnableImpl
decay, decayBaseLevelActivation, getBaseLevelActivation, getBaseLevelDecayStrategy, getBaseLevelExciteStrategy, getLearnableRemovalThreshold, getTotalActivation, getTotalActivationStrategy, isRemovable, reinforceBaseLevelActivation, setBaseLevelActivation, setBaseLevelDecayStrategy, setBaseLevelExciteStrategy, setBaseLevelRemovalThreshold, setTotalActivationStrategy
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
containsParameter, getParam, getParameters, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.tasks.FrameworkTask
cancel, getControllingTaskSpawner, getNextTicksPerRun, getScheduledTick, getTaskId, getTaskStatus, getTicksPerRun, setControllingTaskSpawner, setNextTicksPerRun, setScheduledTick, setTaskStatus, setTicksPerRun, stopRunning
 
Methods inherited from interface java.util.concurrent.Callable
call
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Learnable
decayBaseLevelActivation, getBaseLevelActivation, getBaseLevelDecayStrategy, getBaseLevelExciteStrategy, getLearnableRemovalThreshold, getTotalActivationStrategy, reinforceBaseLevelActivation, setBaseLevelActivation, setBaseLevelDecayStrategy, setBaseLevelExciteStrategy, setBaseLevelRemovalThreshold, setTotalActivationStrategy
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
containsParameter, getParam, getParameters, init
 

Field Detail

pamNodeMap

protected java.util.Map<java.lang.String,PamLinkable> pamNodeMap
Map of PamLinkable


pam

protected PerceptualAssociativeMemory pam
the PerceptualAssociativeMemory


sensoryMemory

protected SensoryMemory sensoryMemory
PamLinkable this algorithm detects

Constructor Detail

MultipleDetectionAlgorithm

public MultipleDetectionAlgorithm()
Method Detail

setAssociatedModule

public void setAssociatedModule(FrameworkModule module,
                                java.lang.String moduleUsage)
Description copied from class: FrameworkTaskImpl
Subclasses may override this method.

Specified by:
setAssociatedModule in interface FullyInitializable
Overrides:
setAssociatedModule in class FrameworkTaskImpl
Parameters:
module - the module to be associated.
moduleUsage - how module will be used
See Also:
ModuleUsage

init

public void init()
This task can be initialized with the following parameters:

nodes type=stringlabels of the Nodes in PerceptualAssociativeMemory this algorithm detects

Specified by:
init in interface Initializable
Overrides:
init in class LearnableImpl
See Also:
Initializable

addPamLinkable

public void addPamLinkable(PamLinkable linkable)
Adds PamLinkable.

Parameters:
linkable - PamLinkable that will be detected by this algorithm

runThisFrameworkTask

protected void runThisFrameworkTask()
Description copied from class: FrameworkTaskImpl
To be overridden by extending classes. Overriding method should execute a handful of statements considered to constitute a single iteration of the task. For example, a codelet might look in a buffer for some content and make a change to it in a single iteration. The overriding method may also change the TaskStatus of a task. For example, if the task should only run once and stop, then the method FrameworkTaskImpl.cancel() may be used to stop the task from further execution (calls of this FrameworkTaskImpl.runThisFrameworkTask() beyond the current one.

Specified by:
runThisFrameworkTask in class FrameworkTaskImpl

detectLinkables

public abstract void detectLinkables()
Override this method for domain-specific feature detection


detect

public double detect()
Description copied from interface: DetectionAlgorithm
Detects a feature.

Specified by:
detect in interface DetectionAlgorithm
Returns:
value from 0.0 to 1.0 representing the degree to which the feature occurs.

getPamLinkable

public PamLinkable getPamLinkable()
Description copied from interface: DetectionAlgorithm
Returns PamLinkable this algorithm can detect.

Specified by:
getPamLinkable in interface DetectionAlgorithm
Returns:
the pam nodes

setPamLinkable

public void setPamLinkable(PamLinkable linkable)
Description copied from interface: DetectionAlgorithm
Adds PamLinkable that will be detected by this algorithm.

Specified by:
setPamLinkable in interface DetectionAlgorithm
Parameters:
linkable - s PamLinkable