edu.memphis.ccrg.lida.sensorymotormemory
Class BasicSensoryMotorMemory

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
      extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
          extended by edu.memphis.ccrg.lida.sensorymotormemory.BasicSensoryMotorMemory
All Implemented Interfaces:
ActionSelectionListener, FrameworkModule, FullyInitializable, Initializable, ModuleListener, SensoryMemoryListener, SensoryMotorMemory

public class BasicSensoryMotorMemory
extends FrameworkModuleImpl
implements SensoryMotorMemory, SensoryMemoryListener, ActionSelectionListener

Default implementation of a Map-based SensoryMotorMemory

Author:
Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
BasicSensoryMotorMemory()
          Default constructor
 
Method Summary
 void addActionAlgorithm(java.lang.Number actionId, java.lang.Object action)
          Adds an Algorithm to this SensoryMotorMemory
 void addListener(ModuleListener listener)
          Override this method to add a listener to the module
 void addSensoryMotorMemoryListener(SensoryMotorMemoryListener l)
          Any non-environment communication should use listeners.
 void decayModule(long ticks)
          Decay only this Module.
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 void init()
          Will set parameters with the following names:

smm.processActionTaskTicks delay (in ticks) on the processing of an Action receive from ActionSelection
 void receiveAction(Action action)
          Listener must receive actions.
 void receiveSensoryMemoryContent(java.lang.Object content)
          This method is used to receive information from sensory memory.
 void sendActuatorCommand(java.lang.Object command)
          Executes specified action algorithm
 void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
          Sets an associated FrameworkModule.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule, toString
 
Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
containsParameter, getParam, getParameters, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
containsParameter, getParam, getParameters, init
 

Constructor Detail

BasicSensoryMotorMemory

public BasicSensoryMotorMemory()
Default constructor

Method Detail

init

public void init()
Will set parameters with the following names:

smm.processActionTaskTicks delay (in ticks) on the processing of an Action receive from ActionSelection

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

addListener

public void addListener(ModuleListener listener)
Description copied from class: FrameworkModuleImpl
Override this method to add a listener to the module

Specified by:
addListener in interface FrameworkModule
Overrides:
addListener in class FrameworkModuleImpl
Parameters:
listener - - listener of this FrameworkModule

addSensoryMotorMemoryListener

public void addSensoryMotorMemoryListener(SensoryMotorMemoryListener l)
Description copied from interface: SensoryMotorMemory
Any non-environment communication should use listeners.

Specified by:
addSensoryMotorMemoryListener in interface SensoryMotorMemory
Parameters:
l - SensoryMotorMemoryListener

setAssociatedModule

public void setAssociatedModule(FrameworkModule module,
                                java.lang.String moduleUsage)
Description copied from interface: FullyInitializable
Sets an associated FrameworkModule.

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

addActionAlgorithm

public void addActionAlgorithm(java.lang.Number actionId,
                               java.lang.Object action)
Adds an Algorithm to this SensoryMotorMemory

Parameters:
actionId - Id of Action which is implemented by the algorithm
action - an algorithm

receiveAction

public void receiveAction(Action action)
Description copied from interface: ActionSelectionListener
Listener must receive actions. Will be called for each action selected by the behavior network.

Specified by:
receiveAction in interface ActionSelectionListener
Parameters:
action - - Id of the action stored in sensory motor memory

sendActuatorCommand

public void sendActuatorCommand(java.lang.Object command)
Description copied from interface: SensoryMotorMemory
Executes specified action algorithm

Specified by:
sendActuatorCommand in interface SensoryMotorMemory
Parameters:
command - algorithm to execute in the agent's actuators or directly in the environment.

decayModule

public void decayModule(long ticks)
Description copied from interface: FrameworkModule
Decay only this Module.

Specified by:
decayModule in interface FrameworkModule
Parameters:
ticks - number of ticks to decay.

getModuleContent

public java.lang.Object getModuleContent(java.lang.Object... params)
Description copied from class: FrameworkModuleImpl
Intended to be called from the GUI. Override this method to return particular module content based on params.

Specified by:
getModuleContent in interface FrameworkModule
Overrides:
getModuleContent in class FrameworkModuleImpl
Parameters:
params - parameters specifying what content will be returned
Returns:
Parameter-specified content of this module.

receiveSensoryMemoryContent

public void receiveSensoryMemoryContent(java.lang.Object content)
Description copied from interface: SensoryMemoryListener
This method is used to receive information from sensory memory. Sensory-Motor Memory calls this method and receives the information of sensory memory.

Specified by:
receiveSensoryMemoryContent in interface SensoryMemoryListener
Parameters:
content - an Object containing SensoryMemory content