edu.memphis.ccrg.lida.proceduralmemory
Class ProceduralMemoryImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
      extended by edu.memphis.ccrg.lida.proceduralmemory.ProceduralMemoryImpl
All Implemented Interfaces:
FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener, ProceduralMemory

public class ProceduralMemoryImpl
extends FrameworkModuleImpl
implements ProceduralMemory, BroadcastListener

Default implementation of ProceduralMemory. Indexes scheme by context elements for quick access.


Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
ProceduralMemoryImpl()
          Default constructor
 
Method Summary
 void activateSchemes(NodeStructure broadcast)
          Using the Broadcast content, activate the relevant schemes of procedural memory
 void addListener(ModuleListener listener)
          Override this method to add a listener to the module
 void addScheme(Scheme scheme)
          Adds specified scheme to this ProceduralMemory.
 void addSchemes(java.util.Collection<Scheme> schemes)
          Adds specified schemes to this procedural memory.
 boolean containsScheme(Scheme s)
          Returns whether this procedural memory contains specified scheme.
 void createInstantiation(Scheme s)
          Instantiates specified scheme.
 void decayModule(long ticks)
          Decay only this Module.
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 SchemeActivationStrategy getSchemeActivationStrategy()
          Returns the SchemeActivationStrategy.
 int getSchemeCount()
          Returns a count of the schemes
 void init()
          This module can accept parameters for the decay and excite strategies for behaviors instantiated in this module.
 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 removeScheme(Scheme scheme)
          Removes specified Scheme.
 void setSchemeActivationStrategy(SchemeActivationStrategy strategy)
          Sets the SchemeActivationStrategy
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getParam, getSubmodule, getSubmodule, getSubmodules, init, setAssistingTaskSpawner, setAssociatedModule, 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
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setModuleName, taskManagerDecayModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.FullyInitializable
setAssociatedModule
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
getParam, init
 

Constructor Detail

ProceduralMemoryImpl

public ProceduralMemoryImpl()
Default constructor

Method Detail

init

public void init()
This module can accept parameters for the decay and excite strategies for behaviors instantiated in this module. The parameters names are:

proceduralMemory.schemeActivationStrategy - name of SchemeActivationStrategy in the ElementFactory
proceduralMemory.behaviorDecayStrategy - name (a String) of the Strategy in the ElementFactory
proceduralMemory.behaviorExciteStrategy - name (a String) of the Strategy in the ElementFactory

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

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

setSchemeActivationStrategy

public void setSchemeActivationStrategy(SchemeActivationStrategy strategy)
Description copied from interface: ProceduralMemory
Sets the SchemeActivationStrategy

Specified by:
setSchemeActivationStrategy in interface ProceduralMemory
Parameters:
strategy - how schemes will be activated based on the broadcast.

getSchemeActivationStrategy

public SchemeActivationStrategy getSchemeActivationStrategy()
Description copied from interface: ProceduralMemory
Returns the SchemeActivationStrategy.

Specified by:
getSchemeActivationStrategy in interface ProceduralMemory
Returns:
SchemeActivationStrategy used to activate Schemes

addSchemes

public void addSchemes(java.util.Collection<Scheme> schemes)
Description copied from interface: ProceduralMemory
Adds specified schemes to this procedural memory.

Specified by:
addSchemes in interface ProceduralMemory
Parameters:
schemes - set of Schemes

addScheme

public void addScheme(Scheme scheme)
Description copied from interface: ProceduralMemory
Adds specified scheme to this ProceduralMemory.

Specified by:
addScheme in interface ProceduralMemory
Parameters:
scheme - Scheme

activateSchemes

public void activateSchemes(NodeStructure broadcast)
Description copied from interface: ProceduralMemory
Using the Broadcast content, activate the relevant schemes of procedural memory

Specified by:
activateSchemes in interface ProceduralMemory
Parameters:
broadcast - conscious contents

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

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

createInstantiation

public void createInstantiation(Scheme s)
Description copied from interface: ProceduralMemory
Instantiates specified scheme.

Specified by:
createInstantiation in interface ProceduralMemory
Parameters:
s - a scheme over threshold

containsScheme

public boolean containsScheme(Scheme s)
Description copied from interface: ProceduralMemory
Returns whether this procedural memory contains specified scheme.

Specified by:
containsScheme in interface ProceduralMemory
Parameters:
s - a Scheme
Returns:
true if it contains an equal scheme

getSchemeCount

public int getSchemeCount()
Description copied from interface: ProceduralMemory
Returns a count of the schemes

Specified by:
getSchemeCount in interface ProceduralMemory
Returns:
number of schemes currently in this procedural memory.

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.

removeScheme

public void removeScheme(Scheme scheme)
Description copied from interface: ProceduralMemory
Removes specified Scheme.

Specified by:
removeScheme in interface ProceduralMemory
Parameters:
scheme - scheme to be removed.

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.