Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

sajas.core.behaviours
Class SequentialBehaviour
java.lang.Object
  sajas.core.behaviours.Behaviour
      sajas.core.behaviours.CompositeBehaviour
          sajas.core.behaviours.SerialBehaviour
              sajas.core.behaviours.SequentialBehaviour
All Implemented Interfaces:
jade.util.leap.Serializable, Serializable

public class SequentialBehaviour
extends SerialBehaviour
Author:
hlc
See Also:
jade.core.behaviours.SerialBehaviour

Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
Fields inherited from class sajas.core.behaviours.CompositeBehaviour
currentExecuted
Fields inherited from class sajas.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
Constructor Summary
SequentialBehaviour()
          Default constructor.
SequentialBehaviour(Agent a)
          This constructor sets the owner agent for this behaviour.
Method Summary
void
addSubBehaviour(Behaviour b)
          Add a sub behaviour to this SequentialBehaviour
protected boolean
checkTermination(boolean currentDone, int currentResult)
          Check whether this SequentialBehaviour must terminate.
jade.util.leap.Collection
getChildren()
          Return a Collection view of the children of this SequentialBehaviour
protected Behaviour
getCurrent()
          Get the current child
void
removeSubBehaviour(Behaviour b)
          Remove a sub behaviour from this SequentialBehaviour
void
reset()
          Puts a CompositeBehaviour back in initial state.
protected void
scheduleFirst()
          Prepare the first child for execution
protected void
scheduleNext(boolean currentDone, int currentResult)
          Sequential policy for children scheduling.
void
skipNext()
Methods inherited from class sajas.core.behaviours.SerialBehaviour
handle
Methods inherited from class sajas.core.behaviours.CompositeBehaviour
action, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgent
Methods inherited from class sajas.core.behaviours.Behaviour
actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, isRunnable, onEnd, onStart, restart, root, setBehaviourName, setDataStore, setExecutionState
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
scheduleFirst
protected void scheduleFirst()
Prepare the first child for execution
Overrides:
scheduleFirst in class CompositeBehaviour
See Also:
jade.core.behaviours.CompositeBehaviour.scheduleFirst()

scheduleNext
protected void scheduleNext(boolean currentDone,
                            int currentResult)
Sequential policy for children scheduling. This method schedules children behaviours one at a time, in a FIFO fashion.
Overrides:
scheduleNext in class CompositeBehaviour
Parameters:
currentDone - a flag indicating whether the just executed child has completed or not.
currentResult - the termination value (as returned by onEnd()) of the just executed child in the case this child has completed (otherwise this parameter is meaningless)
See Also:
jade.core.behaviours.CompositeBehaviour.scheduleNext(boolean, int)

checkTermination
protected boolean checkTermination(boolean currentDone,
                                   int currentResult)
Check whether this SequentialBehaviour must terminate.
Overrides:
checkTermination in class CompositeBehaviour
Parameters:
currentDone - a flag indicating whether the just executed child has completed or not.
currentResult - the termination value (as returned by onEnd()) of the just executed child in the case this child has completed (otherwise this parameter is meaningless)
Returns:
true when the last child has terminated. false otherwise
See Also:
jade.core.behaviours.CompositeBehaviour.checkTermination(boolean, int)

getCurrent
protected Behaviour getCurrent()
Get the current child
Overrides:
getCurrent in class CompositeBehaviour
See Also:
jade.core.behaviours.CompositeBehaviour.getCurrent()

getChildren
public jade.util.leap.Collection getChildren()
Return a Collection view of the children of this SequentialBehaviour
Overrides:
getChildren in class CompositeBehaviour
See Also:
jade.core.behaviours.CompositeBehaviour.getChildren()

addSubBehaviour
public void addSubBehaviour(Behaviour b)
Add a sub behaviour to this SequentialBehaviour

removeSubBehaviour
public void removeSubBehaviour(Behaviour b)
Remove a sub behaviour from this SequentialBehaviour

reset
public void reset()
Description copied from class: CompositeBehaviour
Puts a CompositeBehaviour back in initial state. The internal state is cleaned up and reset() is recursively called for each child behaviour.
Overrides:
reset in class CompositeBehaviour

skipNext
public void skipNext()

Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Java API documentation generated with DocFlex/Doclet 1.6.1 using JavadocPro template set.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc, which is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com