[java]
/**
* Section 4.2.4, Page 61
*
* The TickerBehaviour has action() and done() methods pre-implemented to execute
* the onTick() abstract method repetitively,
* A TickerBehaviour never completes unless it is explicitly removed or
* its stop() method is called.
**/
import jade.core.Agent;
import jade.core.behaviours.TickerBehaviour;
public class MyAgent2 extends Agent {
protected void setup() {
System.out.println("Adding Ticker behaviour");
addBehaviour(new TickerBehaviour(this, 10000) {
protected void onTick() {
// perform operation Y
System.out.println("operation Y");
}
} );
}
}
[/java]