edu.memphis.ccrg.lida.episodicmemory
Class EpisodicMemoryImpl

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.episodicmemory.EpisodicMemoryImpl
All Implemented Interfaces:
CueListener, EpisodicMemory, FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener

public class EpisodicMemoryImpl
extends FrameworkModuleImpl
implements EpisodicMemory, BroadcastListener, CueListener

This is the canonical implementation of EpisodicMemory. It uses a SparseDistributedMemory to store the information.

Author:
Javier Snaider

Field Summary
static int DEF_ACCESS_RADIUS
          Default access radius for SparseDistributedMemory
static int DEF_ADDRESS_LENGTH
          Default address length for SparseDistributedMemory
static int DEF_HARD_LOCATIONS
          Default number of hard locations
static int DEF_WORD_LENGTH
          Default word length for SparseDistributedMemory
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
EpisodicMemoryImpl()
          Constructs a new object with default values
 
Method Summary
 void addListener(ModuleListener listener)
          Override this method to add a listener to the module
 void decayModule(long ticks)
          Decay only this Module.
 SparseDistributedMemory getSdm()
          Returns the SDM used in this EpisodicMemory
 Translator getTranslator()
          Returns the Translator associated with this EpisodicMemoryImpl
 void init()
          Will set parameters with the following names:

em.numOfHardLoc number of hard locations created in SDM to store data
em.addressLength size of the hard locations' address
em.wordLength size of the hard locations' words (storage)
em.activationRadius size of the radius of the hypersphere used to find the "nearby" hard locations of an address
 void learn(Coalition coalition)
          A place-holder method to remind implementing classes that they should implement learning.
 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 receiveCue(NodeStructure ns)
          Receive a cue as a NodeStructure In this implementation, first the cue is translated to a BitVector.
 void setTranslator(Translator translator)
          Sets the Translator of this EpisodicMemoryImpl
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleContent, getModuleName, getSubmodule, getSubmodule, getSubmodules, setAssistingTaskSpawner, setAssociatedModule, 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, getModuleContent, 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
containsParameter, getParam, getParameters, init
 

Field Detail

DEF_HARD_LOCATIONS

public static final int DEF_HARD_LOCATIONS
Default number of hard locations

See Also:
Constant Field Values

DEF_ADDRESS_LENGTH

public static final int DEF_ADDRESS_LENGTH
Default address length for SparseDistributedMemory

See Also:
Constant Field Values

DEF_WORD_LENGTH

public static final int DEF_WORD_LENGTH
Default word length for SparseDistributedMemory

See Also:
Constant Field Values

DEF_ACCESS_RADIUS

public static final int DEF_ACCESS_RADIUS
Default access radius for SparseDistributedMemory

See Also:
Constant Field Values
Constructor Detail

EpisodicMemoryImpl

public EpisodicMemoryImpl()
Constructs a new object with default values

Method Detail

init

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

em.numOfHardLoc number of hard locations created in SDM to store data
em.addressLength size of the hard locations' address
em.wordLength size of the hard locations' words (storage)
em.activationRadius size of the radius of the hypersphere used to find the "nearby" hard locations of an address

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

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

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

receiveCue

public void receiveCue(NodeStructure ns)
Receive a cue as a NodeStructure In this implementation, first the cue is translated to a BitVector.

Specified by:
receiveCue in interface CueListener
Parameters:
ns - NodeStructure to retrieve
See Also:
Translator

learn

public void learn(Coalition coalition)
Description copied from interface: BroadcastListener
A place-holder 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 the GlobalWorkspace and thus it should be managed by the receiving module.

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

setTranslator

public void setTranslator(Translator translator)
Sets the Translator of this EpisodicMemoryImpl

Parameters:
translator - the Translator to set

getTranslator

public Translator getTranslator()
Returns the Translator associated with this EpisodicMemoryImpl

Returns:
the Translator

getSdm

public SparseDistributedMemory getSdm()
Returns the SDM used in this EpisodicMemory

Returns:
the SparseDistributedMemory

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.