MyAgent1.java

[java]
/**
* Section 4.2.4, Page 61
*
* The WakerBehaviour has action() and done() methods pre-implemented to execute the
* onWake() abstract method after a given timeout (specified in the constructor) expires.
**/
import jade.core.Agent;
import jade.core.behaviours.WakerBehaviour;
public class MyAgent1 extends Agent {
protected void setup() {
System.out.println("Adding waker behaviour");
addBehaviour(new WakerBehaviour(this, 10000) {
protected void onWake() {
// perform operation X
System.out.println("operation X");
}
} );
}
}
[/java]