edu.memphis.ccrg.lida.globalworkspace.triggers
Class AggregateCoalitionActivationTrigger

java.lang.Object
  extended by edu.memphis.ccrg.lida.globalworkspace.triggers.AggregateCoalitionActivationTrigger
All Implemented Interfaces:
BroadcastTrigger
Direct Known Subclasses:
IndividualCoaltionActivationTrigger

public class AggregateCoalitionActivationTrigger
extends java.lang.Object
implements BroadcastTrigger

Implements a trigger that is activated when the sum of all Coalitions in GlobalWorkspace is greater than the threshold.

Author:
Javier Snaider

Field Summary
protected  GlobalWorkspace gw
          The GlobalWorkspace
protected  double threshold
          The activation treshold
 
Constructor Summary
AggregateCoalitionActivationTrigger()
           
 
Method Summary
 void checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
          This method is executed each time a new Coalition enters the GlobalWorkspace and calculates the total activation.
 double getThreshold()
           
 void init(java.util.Map<java.lang.String,java.lang.Object> parameters, GlobalWorkspace gw)
          This method is a generic way to setup the Trigger.
 void reset()
          To reset the Trigger.
 void start()
          To start the Trigger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gw

protected GlobalWorkspace gw
The GlobalWorkspace


threshold

protected double threshold
The activation treshold

Constructor Detail

AggregateCoalitionActivationTrigger

public AggregateCoalitionActivationTrigger()
Method Detail

checkForTriggerCondition

public void checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
This method is executed each time a new Coalition enters the GlobalWorkspace and calculates the total activation. If it is over threshold then the broadcast is triggered.

Specified by:
checkForTriggerCondition in interface BroadcastTrigger
Parameters:
coalitions - a Collection of all the Coalitions in the GlobalWorkspace.

reset

public void reset()
Description copied from interface: BroadcastTrigger
To reset the Trigger. Its called each time a new Broadcast is Triggered.

Specified by:
reset in interface BroadcastTrigger

init

public void init(java.util.Map<java.lang.String,java.lang.Object> parameters,
                 GlobalWorkspace gw)
Description copied from interface: BroadcastTrigger
This method is a generic way to setup the Trigger. It should be called when the trigger is created.

Specified by:
init in interface BroadcastTrigger
Parameters:
parameters - a map for generic parameters.
gw - A TriggerListener. Most of the cases is the same class that implements GlobalWorkspace Interface.

start

public void start()
Description copied from interface: BroadcastTrigger
To start the Trigger

Specified by:
start in interface BroadcastTrigger

getThreshold

public double getThreshold()
Returns:
threshold