jade.core.behaviours
Class SequentialBehaviour

java.lang.Object
  |
  +--jade.core.behaviours.Behaviour
        |
        +--jade.core.behaviours.ComplexBehaviour
              |
              +--jade.core.behaviours.SequentialBehaviour

public class SequentialBehaviour
extends ComplexBehaviour

Composite behaviour with sequential children scheduling. It is a ComplexBehaviour that executes its children behaviours in sequential order, and terminates when its last child has ended.

Author:
Giovanni Rimassa - Universita` di Parma
See Also:
Serialized Form

Inner classes inherited from class jade.core.behaviours.ComplexBehaviour
ComplexBehaviour.BehaviourList
 
Inner classes inherited from class jade.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
 
Fields inherited from class jade.core.behaviours.ComplexBehaviour
subBehaviours
 
Fields inherited from class jade.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent
 
Constructor Summary
SequentialBehaviour()
          Default constructor.
SequentialBehaviour(Agent a)
          This constructor sets the owner agent for this behaviour.
 
Method Summary
protected  boolean bodyAction()
          Sequential policy for children scheduling.
protected  void handle(Behaviour.RunnableChangedEvent rce)
          Handle block/restart notifications.
 
Methods inherited from class jade.core.behaviours.ComplexBehaviour
action, addSubBehaviour, done, postAction, preAction, removeSubBehaviour, reset, restart
 
Methods inherited from class jade.core.behaviours.Behaviour
block, block, isRunnable, root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequentialBehaviour

public SequentialBehaviour()
Default constructor. It does not set the owner agent for this behaviour.

SequentialBehaviour

public SequentialBehaviour(Agent a)
This constructor sets the owner agent for this behaviour.
Parameters:
a - The agent this behaviour belongs to.
Method Detail

bodyAction

protected boolean bodyAction()
Sequential policy for children scheduling. This method executes children behaviours one at a time, in a FIFO fashion.
Overrides:
bodyAction in class ComplexBehaviour
See Also:
ComplexBehaviour.bodyAction()

handle

protected void handle(Behaviour.RunnableChangedEvent rce)
Handle block/restart notifications. A SequentialBehaviour is blocked only when its currently active child is blocked, and becomes ready again when its current child is ready. This method takes care of the various possibilities.
Parameters:
rce - The event to handle.
Overrides:
handle in class ComplexBehaviour