edu.memphis.ccrg.lida.attentioncodelets
Class AttentionCodeletModule

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
      extended by edu.memphis.ccrg.lida.attentioncodelets.AttentionCodeletModule
All Implemented Interfaces:
PreafferenceListener, FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener, CodeletManagerModule

public class AttentionCodeletModule
extends FrameworkModuleImpl
implements BroadcastListener, PreafferenceListener, CodeletManagerModule

FrameworkModule which creates and manages all AttentionCodelet.

Author:
Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
AttentionCodeletModule()
          Default constructor
 
Method Summary
 void addCodelet(Codelet codelet)
          Adds specified Codelet to this module to be run.
 void decayModule(long ticks)
          Decay only this Module.
 AttentionCodelet getCodelet(java.lang.String type)
          Returns a new Codelet of the specified type or null if this type is not supported.
 AttentionCodelet getCodelet(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the specified type or null if this type is not supported.
 AttentionCodelet getDefaultCodelet()
          Returns a new Codelet of the default type of the Manager
 AttentionCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
          Returns a new Codelet of the default type of the Manager
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 void init()
          Will set parameters with the following names:

attentionModule.defaultCodeletType
attentionModule.codeletActivation
attentionModule.codeletRemovalThreshold
 void learn(BroadcastContent content)
          This is a placeholder method to remind implementing classes that they should implement learning.
 void receiveBroadcast(BroadcastContent bc)
          This method should return as possible in order to not delay the rest of the broadcasting.
 void receivePreafference(NodeStructure addSet, NodeStructure deleteSet)
          Listener receives preafference.
 void setAssociatedModule(FrameworkModule module, java.lang.String moduleUsage)
          Sets an associated FrameworkModule.
 void setDefaultCodeletType(java.lang.String type)
          Sets default codelet type used by this Manager.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getParam, getSubmodule, getSubmodule, getSubmodules, init, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule, toString
 
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
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
getParam, init
 

Constructor Detail

AttentionCodeletModule

public AttentionCodeletModule()
Default constructor

Method Detail

init

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

attentionModule.defaultCodeletType
attentionModule.codeletActivation
attentionModule.codeletRemovalThreshold

Specified by:
init in interface Initializable
Overrides:
init in class FrameworkModuleImpl
See Also:
FrameworkModuleImpl.init()

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 ModuleUsage

setDefaultCodeletType

public void setDefaultCodeletType(java.lang.String type)
Description copied from interface: CodeletManagerModule
Sets default codelet type used by this Manager.

Specified by:
setDefaultCodeletType in interface CodeletManagerModule
Parameters:
type - type name of codelet in the ElementFactory
See Also:
ElementFactory

receiveBroadcast

public void receiveBroadcast(BroadcastContent bc)
Description copied from interface: BroadcastListener
This method should return as possible in order to not delay the rest of the broadcasting. A good implementation should copy the broadcast content and create a task to process it.

Specified by:
receiveBroadcast in interface BroadcastListener
Parameters:
bc - the Content of the Broadcast

getDefaultCodelet

public AttentionCodelet getDefaultCodelet(java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Parameters:
params - Optional parameters or null
Returns:
new default Codelet

getDefaultCodelet

public AttentionCodelet getDefaultCodelet()
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the default type of the Manager

Specified by:
getDefaultCodelet in interface CodeletManagerModule
Returns:
new default Codelet

getCodelet

public AttentionCodelet getCodelet(java.lang.String type)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
type - Codelet type
Returns:
new Codelet of specified type or null if type is not supported
See Also:
ElementFactory

getCodelet

public AttentionCodelet getCodelet(java.lang.String type,
                                   java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: CodeletManagerModule
Returns a new Codelet of the specified type or null if this type is not supported.

Specified by:
getCodelet in interface CodeletManagerModule
Parameters:
type - Codelet type
params - Optional parameters or null
Returns:
new Codelet of specified type or null if type is not supported

addCodelet

public void addCodelet(Codelet codelet)
Description copied from interface: CodeletManagerModule
Adds specified Codelet to this module to be run.

Specified by:
addCodelet in interface CodeletManagerModule
Parameters:
codelet - Codelet to be added to run

receivePreafference

public void receivePreafference(NodeStructure addSet,
                                NodeStructure deleteSet)
Description copied from interface: PreafferenceListener
Listener receives preafference.

Specified by:
receivePreafference in interface PreafferenceListener
Parameters:
addSet - expected additions in future percepts
deleteSet - expected deletions in future percepts

learn

public void learn(BroadcastContent content)
Description copied from interface: BroadcastListener
This is a placeholder method to remind implementing classes that they should implement learning. LIDA theory says receivers of the broadcast should learn from it. This method will not be called directly by GlobalWorkspace but should be managed by the receiving module.

Specified by:
learn in interface BroadcastListener
Parameters:
content - content

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 - - specifies what content will be returned.
Returns:
various kinds of content of this module.

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.