/********************************************************************* Bad2.java: Second attempt at combining sequential actions with --------- a cyclic Looper behaviour. We repeat the sequential behaviour to see the effect of calling block() twice. Author: Jean Vaucher Date: Aug 3 2003 ***********************************************************************/ import jade.core.Agent; import jade.core.behaviours.*; public class Bad2 extends Agent { protected void setup() { addBehaviour( new TwoStep() ); addBehaviour( new Looper( this, 300 ) ); } } class TwoStep extends SimpleBehaviour { public void action() { block(250); System.out.println( "--- Message 1 --- " ); block(500); System.out.println( " - message 2 " ); } private int n = 0; public boolean done() { return ++n > 3; } }