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

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.workspace.workspacebuffers.BroadcastQueueImpl
All Implemented Interfaces:
FrameworkModule, FullyInitializable, Initializable, ModuleListener, BroadcastListener, BroadcastQueue, WorkspaceBuffer

public class BroadcastQueueImpl
extends FrameworkModuleImpl
implements BroadcastQueue

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 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)
          Intended to be called from the GUI.
 WorkspaceContent getPositionContent(int index)
          Returns content of specified position
 void init()
          Will set parameters with the following names:

workspace.broadcastQueueCapacity the number of recent broadcast maintained in this BroadcastQueue
 void learn(Coalition coalition)
          A place-holder method to remind implementing classes that they should implement learning.
 void receiveBroadcast(Coalition c)
          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.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
addListener, addSubModule, containsSubmodule, containsSubmodule, getAssistingTaskSpawner, 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
addListener, 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
containsParameter, getParam, getParameters, init
 

Constructor Detail

BroadcastQueueImpl

public BroadcastQueueImpl()
Default constructor

Method Detail

init

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

workspace.broadcastQueueCapacity the number of recent broadcast maintained in this BroadcastQueue

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

receiveBroadcast

public void receiveBroadcast(Coalition c)
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:
c - the Coalition that won the most recent 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.

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

getPositionContent

public WorkspaceContent getPositionContent(int index)
Description copied from interface: BroadcastQueue
Returns content of specified position

Specified by:
getPositionContent in interface BroadcastQueue
Parameters:
index - position in the queue
Returns:
WorkspaceContent at index position or null

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(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