|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.memphis.ccrg.lida.globalworkspace.triggers.AggregateCoalitionActivationTrigger
public class AggregateCoalitionActivationTrigger
Implements a trigger that is activated when the sum of all Coalition objects
in GlobalWorkspace is greater than a threshold.
| Field Summary | |
|---|---|
protected GlobalWorkspace |
gw
Reference to the GlobalWorkspace |
protected double |
threshold
The activation threshold |
| Constructor Summary | |
|---|---|
AggregateCoalitionActivationTrigger()
|
|
| Method Summary | |
|---|---|
void |
checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
Calculates the aggregate activation of all coalitions in the GlobalWorkspace and
if it is over threshold a broadcast is triggered. |
double |
getThreshold()
Gets threshold |
void |
init(java.util.Map<java.lang.String,java.lang.Object> parameters,
GlobalWorkspace gw)
This method expects a parameter with name "threshold" of type double representing the coalition activation threshold at which the trigger will fire. |
void |
reset()
Resets the trigger. |
void |
start()
Starts the trigger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GlobalWorkspace gw
GlobalWorkspace
protected double threshold
| Constructor Detail |
|---|
public AggregateCoalitionActivationTrigger()
| Method Detail |
|---|
public void checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
GlobalWorkspace and
if it is over threshold a broadcast is triggered.
This method is called each time a new Coalition enters the GlobalWorkspace
checkForTriggerCondition in interface BroadcastTriggercoalitions - a Collection of all the Coalition objects in the GlobalWorkspace.GlobalWorkspaceImpl.addCoalition(Coalition)public void reset()
BroadcastTrigger
reset in interface BroadcastTrigger
public void init(java.util.Map<java.lang.String,java.lang.Object> parameters,
GlobalWorkspace gw)
init in interface BroadcastTriggerparameters - a map for generic parametersgw - A TriggerListener and likely a class that implements the GlobalWorkspace interface.BroadcastTrigger.init(Map, GlobalWorkspace)public void start()
BroadcastTrigger
start in interface BroadcastTriggerpublic double getThreshold()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||