Q: Multiple agents thread synchronization I have a java code, that should be read by multiple agents, which
were created by the JADE platform. Each agent has his own thread of execution. 
Therefore, all my agents run my java code concurrently, but not simultaneously.
I've tried using the Class CyclicBarrier from java API, that should 
create a barrier in a way that all the agent's threads get together when passing
trough this barrier, but this class does not work for agent's threads,
just for java threads.
Does anybody know a way of synchronizing those agent's threads?
Any suggestions?

A: the fact that Agents in Jade run on a thread and handle their behaviours on that thread means one could utilise CyclicBreaker from the java concurrency packages (java.util.concurrent.CyclicBarrier). Or a more simple form would be the CountDownLatch. But this is in of itself, a OneShotBehaviour implementation. 
Sequencing of agent behaviour can be done by using a switch case within each interacting agent behaviour
int state = 0;
switch(state){
 state 0:
   // Do action one
   break;
 state 1:
   // Do action two
   break;
}
state++;


A: I put a delay in same agents this way:
try{
  Thread.sleep(1000);                 //1000 milliseconds is one second.
} catch(InterruptedException ex) {
  Thread.currentThread().interrupt();
}

I hope to help you.
