|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.memphis.ccrg.lida.framework.FrameworkModuleImpl
edu.memphis.ccrg.lida.globalworkspace.GlobalWorkspaceImpl
public class GlobalWorkspaceImpl
This class implements GlobalWorkspace and maintains the collection of
Coalition
s. It supports BroadcastTrigger
s that are in charge
of triggering the new broadcast. Triggers should implement
BroadcastTrigger
interface. This class maintains a list of
BroadcastListener
s. These are the modules that need to receive
broadcast content.
Field Summary |
---|
Fields inherited from class edu.memphis.ccrg.lida.framework.FrameworkModuleImpl |
---|
taskSpawner |
Constructor Summary | |
---|---|
GlobalWorkspaceImpl()
Constructor a new instance with default values |
Method Summary | |
---|---|
void |
addBroadcastListener(BroadcastListener bl)
To register a BroadcastListener . |
void |
addBroadcastTrigger(BroadcastTrigger t)
To register Triggers |
boolean |
addCoalition(Coalition coalition)
This method is invoked by the AttentionCodelet to add a new
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 broadcastSentCount |
DecayStrategy |
getCoalitionDecayStrategy()
Gets coalitionDecayStrategy |
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()
Will set the parameters with the following names: globalWorkspace.coalitionRemovalThreshold globalWorkspace.coalitionDecayStrategy globalWorkspace.refractoryPeriod |
void |
setCoalitionDecayStrategy(DecayStrategy coalitionDecayStrategy)
Sets coalitionDecayStrategy |
void |
setCoalitionRemovalThreshold(double coalitionRemovalThreshold)
Sets coalition removal threshold |
void |
setRefractoryPeriod(int period)
Sets refractoryPeriod |
void |
triggerBroadcast(BroadcastTrigger trigger)
Listener must be able to trigger a broadcast |
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 |
---|
public GlobalWorkspaceImpl()
Method Detail |
---|
public void init()
init
in interface Initializable
init
in class FrameworkModuleImpl
FrameworkModuleImpl.init()
public void addListener(ModuleListener listener)
FrameworkModuleImpl
addListener
in interface FrameworkModule
addListener
in class FrameworkModuleImpl
listener
- - listener of this FrameworkModulepublic void addBroadcastListener(BroadcastListener bl)
GlobalWorkspace
BroadcastListener
. Each registered
BroadcastListener
receives Broadcast Implements Observer Pattern
addBroadcastListener
in interface GlobalWorkspace
bl
- the BroadcastListener to registerpublic void addBroadcastTrigger(BroadcastTrigger t)
GlobalWorkspace
addBroadcastTrigger
in interface GlobalWorkspace
t
- a new Triggerpublic boolean addCoalition(Coalition coalition)
GlobalWorkspace
AttentionCodelet
to add a new
Coalition
addCoalition
in interface GlobalWorkspace
coalition
- to be added
public void triggerBroadcast(BroadcastTrigger trigger)
TriggerListener
triggerBroadcast
in interface TriggerListener
trigger
- that wants to start the broadcastpublic java.lang.Object getModuleContent(java.lang.Object... params)
FrameworkModuleImpl
getModuleContent
in interface FrameworkModule
getModuleContent
in class FrameworkModuleImpl
params
- - specifies what content will be returned.
public void decayModule(long ticks)
FrameworkModule
decayModule
in interface FrameworkModule
ticks
- number of ticks to decay.public long getBroadcastSentCount()
GlobalWorkspace
getBroadcastSentCount
in interface GlobalWorkspace
public int getRefractoryPeriod()
getRefractoryPeriod
in interface RefractoryPeriod
TaskManager
public long getTickAtLastBroadcast()
GlobalWorkspace
getTickAtLastBroadcast
in interface GlobalWorkspace
public void setRefractoryPeriod(int period)
setRefractoryPeriod
in interface RefractoryPeriod
period
- number of ticks that must pass after a broadcast has been
sent before a new one can be sent.TaskManager
public double getCoalitionRemovalThreshold()
GlobalWorkspace
getCoalitionRemovalThreshold
in interface GlobalWorkspace
GlobalWorkspace
public void setCoalitionRemovalThreshold(double coalitionRemovalThreshold)
GlobalWorkspace
setCoalitionRemovalThreshold
in interface GlobalWorkspace
coalitionRemovalThreshold
- lower bound for coalitions to remain in the GlobalWorkspace
public DecayStrategy getCoalitionDecayStrategy()
GlobalWorkspace
getCoalitionDecayStrategy
in interface GlobalWorkspace
DecayStrategy
by which coalitions will be decayed.public void setCoalitionDecayStrategy(DecayStrategy coalitionDecayStrategy)
GlobalWorkspace
setCoalitionDecayStrategy
in interface GlobalWorkspace
coalitionDecayStrategy
- DecayStrategy
by which coalitions will be decayed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |