edu.memphis.ccrg.lida.attentioncodelets
Class AttentionCodeletModule

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.attentioncodelets.AttentionCodeletModule
All Implemented Interfaces:
PreafferenceListener, CodeletManagerModule, FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener

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 type of attention codelets obtained from this module
attentionModule.codeletActivation initial activation of codelets obtained from this module
attentionModule.codeletRemovalThreshold initial removal threshold for codelets obtained from this module
attentionModule.codeletReinforcement amount of reinforcement codelets' base-level activation receives during learning
 void learn(Coalition winningCoalition)
          Performs learning based on the AttentionCodelet that created the current
winning Coalition
 void receiveBroadcast(Coalition coalition)
          Listener must receive a broadcast of a the winning Coalition 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, 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
addListener, 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

AttentionCodeletModule

public AttentionCodeletModule()
Default constructor

Method Detail

init

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

attentionModule.defaultCodeletType type of attention codelets obtained from this module
attentionModule.codeletActivation initial activation of codelets obtained from this module
attentionModule.codeletRemovalThreshold initial removal threshold for codelets obtained from this module
attentionModule.codeletReinforcement amount of reinforcement codelets' base-level activation receives during learning

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

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

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(Coalition coalition)
Description copied from interface: BroadcastListener
Listener must receive a broadcast of a the winning Coalition This method should return as possible in order to not delay the rest of the broadcasting.

Specified by:
receiveBroadcast in interface BroadcastListener
Parameters:
coalition - the Coalition that won the most recent competition for consciousness

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(Coalition winningCoalition)
Performs learning based on the AttentionCodelet that created the current
winning Coalition

Specified by:
learn in interface BroadcastListener
Parameters:
winningCoalition - current Coalition winning competition for consciousness

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.

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.