edu.memphis.ccrg.lida.globalworkspace
Class GlobalWorkspaceImpl

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.globalworkspace.GlobalWorkspaceImpl
All Implemented Interfaces:
FrameworkModule, FullyInitializable, Initializable, RefractoryPeriod, GlobalWorkspace, TriggerListener

public class GlobalWorkspaceImpl
extends FrameworkModuleImpl
implements GlobalWorkspace

The default implementation of GlobalWorkspace which maintains the collection of Coalition objects. It supports BroadcastTrigger tasks that are in charge of triggering the new broadcast. This class maintains a list of BroadcastListener which are the modules that are registered to receive winning coalitions.

Author:
Javier Snaider, Ryan J. McCall

Field Summary
 
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
taskSpawner
 
Constructor Summary
GlobalWorkspaceImpl()
          Constructs a new instance with default values
 
Method Summary
 void addBroadcastListener(BroadcastListener bl)
          Adds and registers a BroadcastListener.
 void addBroadcastTrigger(BroadcastTrigger t)
          Adds and registers specified BroadcastTrigger
 boolean addCoalition(Coalition coalition)
          Adds specified Coalition
 void addListener(ModuleListener listener)
          Override this method to add a listener to the module
 void decayModule(long ticks)
          Decay only this Module.
 long getBroadcastSentCount()
          Returns the number of broadcasts sent.
 DecayStrategy getCoalitionDecayStrategy()
          Gets the DecayStrategy used by Coalition objects in this module
 double getCoalitionRemovalThreshold()
          Gets coalition removal threshold
 java.lang.Object getModuleContent(java.lang.Object... params)
          Intended to be called from the GUI.
 int getRefractoryPeriod()
          Gets refractoryPeriod
 long getTickAtLastBroadcast()
          Gets the tick at last broadcast
 void init()
          Initializes parameters with the following names and types:

globalWorkspace.coalitionRemovalThreshold type=double amount of activation coalitions must have to remain in the GlobalWorkspace
globalWorkspace.coalitionDecayStrategy type=string name of the decay strategy used by all coalitions in the GlobalWorkspace
globalWorkspace.refractoryPeriod type=int minimum amount of time allowed between subsequent broadcasts
 void setCoalitionDecayStrategy(DecayStrategy coalitionDecayStrategy)
          Sets the DecayStrategy used by Coalition objects in this module
 void setCoalitionRemovalThreshold(double coalitionRemovalThreshold)
          Sets coalition removal threshold
 void setRefractoryPeriod(int period)
          Sets refractoryPeriod
 void triggerBroadcast(BroadcastTrigger trigger)
          Listener must trigger a competition for consciousness and a conscious broadcast of the winner
 
Methods inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl
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
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

GlobalWorkspaceImpl

public GlobalWorkspaceImpl()
Constructs a new instance with default values

Method Detail

init

public void init()
Initializes parameters with the following names and types:

globalWorkspace.coalitionRemovalThreshold type=double amount of activation coalitions must have to remain in the GlobalWorkspace
globalWorkspace.coalitionDecayStrategy type=string name of the decay strategy used by all coalitions in the GlobalWorkspace
globalWorkspace.refractoryPeriod type=int minimum amount of time allowed between subsequent broadcasts

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

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

addBroadcastListener

public void addBroadcastListener(BroadcastListener bl)
Description copied from interface: GlobalWorkspace
Adds and registers a BroadcastListener. Each registered BroadcastListener receives each conscious broadcast.

Specified by:
addBroadcastListener in interface GlobalWorkspace
Parameters:
bl - the BroadcastListener that will be registered

addBroadcastTrigger

public void addBroadcastTrigger(BroadcastTrigger t)
Description copied from interface: GlobalWorkspace
Adds and registers specified BroadcastTrigger

Specified by:
addBroadcastTrigger in interface GlobalWorkspace
Parameters:
t - a BroadcastTrigger which can initiate a broadcast

addCoalition

public boolean addCoalition(Coalition coalition)
Description copied from interface: GlobalWorkspace
Adds specified Coalition

Specified by:
addCoalition in interface GlobalWorkspace
Parameters:
coalition - the Coalition to be added to the GlobalWorkspace
Returns:
true if coalition was added

triggerBroadcast

public void triggerBroadcast(BroadcastTrigger trigger)
Description copied from interface: TriggerListener
Listener must trigger a competition for consciousness and a conscious broadcast of the winner

Specified by:
triggerBroadcast in interface TriggerListener
Parameters:
trigger - trigger that is initiating the broadcast

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.

getBroadcastSentCount

public long getBroadcastSentCount()
Description copied from interface: GlobalWorkspace
Returns the number of broadcasts sent.

Specified by:
getBroadcastSentCount in interface GlobalWorkspace
Returns:
the current number of broadcasts sent by the module

getRefractoryPeriod

public int getRefractoryPeriod()
Gets refractoryPeriod

Specified by:
getRefractoryPeriod in interface RefractoryPeriod
Returns:
number of ticks that must pass after a broadcast has been sent before a new one can be sent.
See Also:
TaskManager

getTickAtLastBroadcast

public long getTickAtLastBroadcast()
Description copied from interface: GlobalWorkspace
Gets the tick at last broadcast

Specified by:
getTickAtLastBroadcast in interface GlobalWorkspace
Returns:
the tick when the last broadcast occurred

setRefractoryPeriod

public void setRefractoryPeriod(int period)
Sets refractoryPeriod

Specified by:
setRefractoryPeriod in interface RefractoryPeriod
Parameters:
period - number of ticks that must pass after a broadcast has been sent before a new one can be sent.
See Also:
TaskManager

getCoalitionRemovalThreshold

public double getCoalitionRemovalThreshold()
Description copied from interface: GlobalWorkspace
Gets coalition removal threshold

Specified by:
getCoalitionRemovalThreshold in interface GlobalWorkspace
Returns:
lower bound of activation for a Coalition to remain in the module

setCoalitionRemovalThreshold

public void setCoalitionRemovalThreshold(double coalitionRemovalThreshold)
Description copied from interface: GlobalWorkspace
Sets coalition removal threshold

Specified by:
setCoalitionRemovalThreshold in interface GlobalWorkspace
Parameters:
coalitionRemovalThreshold - lower bound of activation for a Coalition to remain in the module

getCoalitionDecayStrategy

public DecayStrategy getCoalitionDecayStrategy()
Description copied from interface: GlobalWorkspace
Gets the DecayStrategy used by Coalition objects in this module

Specified by:
getCoalitionDecayStrategy in interface GlobalWorkspace
Returns:
DecayStrategy by which coalitions will be decayed.

setCoalitionDecayStrategy

public void setCoalitionDecayStrategy(DecayStrategy coalitionDecayStrategy)
Description copied from interface: GlobalWorkspace
Sets the DecayStrategy used by Coalition objects in this module

Specified by:
setCoalitionDecayStrategy in interface GlobalWorkspace
Parameters:
coalitionDecayStrategy - the DecayStrategy used to decay coalition objects