|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjade.core.behaviours.Behaviour
jade.core.behaviours.CompositeBehaviour
jade.core.behaviours.SerialBehaviour
jade.core.behaviours.SequentialBehaviour
public class SequentialBehaviour
Composite behaviour with sequential children scheduling. It is a
CompositeBehaviour that executes its children behaviours
in sequential order, and terminates when its last child has ended.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jade.core.behaviours.Behaviour |
|---|
Behaviour.RunnableChangedEvent |
| Field Summary |
|---|
| Fields inherited from class jade.core.behaviours.CompositeBehaviour |
|---|
currentExecuted |
| Fields inherited from class jade.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. |
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 jade.core.behaviours.SerialBehaviour |
|---|
handle |
| Methods inherited from class jade.core.behaviours.CompositeBehaviour |
|---|
action, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgent |
| Methods inherited from class jade.core.behaviours.Behaviour |
|---|
actionWrapper, block, block, 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 |
|---|
public SequentialBehaviour()
public SequentialBehaviour(Agent a)
a - The agent this behaviour belongs to.| Method Detail |
|---|
protected void scheduleFirst()
scheduleFirst in class CompositeBehaviourCompositeBehaviour.scheduleFirst()
protected void scheduleNext(boolean currentDone,
int currentResult)
scheduleNext in class CompositeBehaviourcurrentDone - 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)CompositeBehaviour.scheduleNext(boolean, int)
protected boolean checkTermination(boolean currentDone,
int currentResult)
SequentialBehaviour must terminate.
checkTermination in class CompositeBehaviourcurrentDone - 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)
CompositeBehaviour.checkTermination(boolean, int)protected Behaviour getCurrent()
getCurrent in class CompositeBehaviourCompositeBehaviour.getCurrent()public Collection getChildren()
SequentialBehaviour
getChildren in class CompositeBehaviourCompositeBehaviour.getChildren()public void addSubBehaviour(Behaviour b)
SequentialBehaviour
public void removeSubBehaviour(Behaviour b)
SequentialBehaviour
public void reset()
CompositeBehaviourCompositeBehaviour back in initial state. The
internal state is cleaned up and reset() is
recursively called for each child behaviour.
reset in class CompositeBehaviourpublic void skipNext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||