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

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

public class NoBroadcastOccurringTrigger
extends java.lang.Object
implements BroadcastTrigger

A triggers that fires when a certain number of ticks have passed without having a broadcast occur.

Author:
Javier Snaider

Constructor Summary
NoBroadcastOccurringTrigger()
           
 
Method Summary
 void checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
          When called the trigger checks if its firing condition.
 int getDelay()
          Gets delay
 TaskManager getTaskManager()
          Gets the Task Manager
 void init(java.util.Map<java.lang.String,java.lang.Object> parameters, GlobalWorkspace gw)
          This method expects an Integer with name "delay" standing for trigger delay.
 void reset()
          Resets the trigger.
 void setTaskManager(TaskManager taskManager)
          Sets the Task Manager
 void start()
          Starts the trigger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoBroadcastOccurringTrigger

public NoBroadcastOccurringTrigger()
Method Detail

getTaskManager

public TaskManager getTaskManager()
Gets the Task Manager

Returns:
the TaskManager

getDelay

public int getDelay()
Gets delay

Returns:
number of ticks that must pass without a broadcast before this trigger fires

setTaskManager

public void setTaskManager(TaskManager taskManager)
Sets the Task Manager

Parameters:
taskManager - the TaskManager

init

public void init(java.util.Map<java.lang.String,java.lang.Object> parameters,
                 GlobalWorkspace gw)
This method expects an Integer with name "delay" standing for trigger delay. Also a String, "name" of the trigger for logging purposes.

Specified by:
init in interface BroadcastTrigger
Parameters:
parameters - a map for generic parameters
gw - A TriggerListener and likely a class that implements the GlobalWorkspace interface.
See Also:
BroadcastTrigger.init(Map, GlobalWorkspace)

start

public void start()
Description copied from interface: BroadcastTrigger
Starts the trigger.

Specified by:
start in interface BroadcastTrigger

checkForTriggerCondition

public void checkForTriggerCondition(java.util.Collection<Coalition> coalitions)
Description copied from interface: BroadcastTrigger
When called the trigger checks if its firing condition. If it has it initiates a competition for consciousness. This method is called for all registered triggers each time a new Coalition is put in the GlobalWorkspace

Specified by:
checkForTriggerCondition in interface BroadcastTrigger
Parameters:
coalitions - All the Coalition objects currently in the GlobalWorkspace.

reset

public void reset()
Description copied from interface: BroadcastTrigger
Resets the trigger. Called each time a new broadcast is triggered.

Specified by:
reset in interface BroadcastTrigger