edu.memphis.ccrg.lida.workspace.workspaceBuffer
Class BroadcastQueueImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
      extended by edu.memphis.ccrg.lida.workspace.workspaceBuffer.BroadcastQueueImpl
All Implemented Interfaces:
FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener, WorkspaceBuffer

public class BroadcastQueueImpl
extends FrameworkModuleImpl
implements WorkspaceBuffer, BroadcastListener

The BroadcastQueue is the data structure storing the recent contents of consciousness. It is a submodule of the Workspace. There is a limit on the queue's capacity and on the amount of activation Linkables must have to remain in the queue.

Author:
Ryan J McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
BroadcastQueueImpl()
          Default constructor
 
Method Summary
 void addBufferContent(WorkspaceContent content)
          Adds specified content to this workspace buffer.
 void addListener(ModuleListener listener)
          Generic way to add various kinds of listeners.
 void decayModule(long ticks)
          Decay only this Module.
 WorkspaceContent getBufferContent(java.util.Map<java.lang.String,java.lang.Object> params)
          Gets buffer content based on specified parameters.
 java.lang.Object getModuleContent(java.lang.Object... params)
          Returns module content specified by params.
 void init()
          Implementations should only perform initialization of variables or objects that depend on parameters in the parameter map specified in FrameworkModuleImpl.init(Map).
 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.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getParam, getSubmodule, getSubmodule, getSubmodules, init, setAssistingTaskSpawner, setAssociatedModule, setModuleName, taskManagerDecayModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.FrameworkModule
addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, getModuleName, getSubmodule, getSubmodule, 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

BroadcastQueueImpl

public BroadcastQueueImpl()
Default constructor

Method Detail

init

public void init()
Description copied from class: FrameworkModuleImpl
Implementations should only perform initialization of variables or objects that depend on parameters in the parameter map specified in FrameworkModuleImpl.init(Map). Furthermore they should not try to access modules added via FrameworkModuleImpl.setAssociatedModule(FrameworkModule, String) as this method will not have run yet at the time this method is called.

Specified by:
init in interface Initializable
Specified by:
init in class FrameworkModuleImpl

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

getModuleContent

public java.lang.Object getModuleContent(java.lang.Object... params)
Description copied from interface: FrameworkModule
Returns module content specified by params. Should only be used by the GUI.

Specified by:
getModuleContent in interface FrameworkModule
Specified by:
getModuleContent in class FrameworkModuleImpl
Parameters:
params - - specifies what content will be returned.
Returns:
various kinds of content of this module.

addBufferContent

public void addBufferContent(WorkspaceContent content)
Description copied from interface: WorkspaceBuffer
Adds specified content to this workspace buffer.

Specified by:
addBufferContent in interface WorkspaceBuffer
Parameters:
content - WorkspaceContent to add

getBufferContent

public WorkspaceContent getBufferContent(java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: WorkspaceBuffer
Gets buffer content based on specified parameters.

Specified by:
getBufferContent in interface WorkspaceBuffer
Parameters:
params - optional parameters to specify what content is returned
Returns:
WorkspaceContent

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.

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

addListener

public void addListener(ModuleListener listener)
Description copied from interface: FrameworkModule
Generic way to add various kinds of listeners.

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