|
Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour |
Behaviour.RunnableChangedEvent |
Field Summary | ||
static int |
WHEN_ALL Predefined constant to be used in the constructor to create a ParallelBehaviour that terminates when all its children are done. |
|
static int |
WHEN_ANY Predefined constant to be used in the constructor to create a ParallelBehaviour that terminates when any of its child is done. |
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 | ||
ParallelBehaviour() Construct a ParallelBehaviour without setting the owner agent, and using the default termination condition (i.e. |
||
ParallelBehaviour(int endCondition) Construct a ParallelBehaviour without setting the owner agent. |
||
ParallelBehaviour(Agent a, int endCondition) Construct a ParallelBehaviour setting the owner agent. |
Method Summary | ||
void |
addSubBehaviour(Behaviour b) Add a sub behaviour to this ParallelBehaviour |
|
protected boolean |
checkTermination(boolean currentDone, int currentResult) Check whether this ParallelBehaviour must terminate. |
|
jade.util.leap.Collection |
getChildren() Return a Collection view of the children of this ParallelBehaviour |
|
protected Behaviour |
getCurrent() Get the current child |
|
jade.util.leap.Collection |
getTerminatedChildren() Return a Collection view of the children of this ParallelBehaviour that have already completed. |
|
protected void |
handle(Behaviour.RunnableChangedEvent rce) Handle block/restart notifications. |
|
void |
removeSubBehaviour(Behaviour b) Remove a sub behaviour from this ParallelBehaviour |
|
void |
reset() Resets this behaviour. |
|
protected void |
scheduleFirst() Prepare the first child for execution |
|
protected void |
scheduleNext(boolean currentDone, int currentResult) This method schedules children behaviours one at a time, in a round robin fashion. |
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 |
ParallelBehaviour
that terminates when all its
children are done.ParallelBehaviour
that terminates when any of
its child is done.ParallelBehaviour
without setting the
owner agent, and using the default termination condition
(i.e. the parallel behaviour terminates as soon as all its
children behaviours terminate.ParallelBehaviour
without setting the
owner agent.ParallelBehaviour
. Use
WHEN_ALL
to terminate this ParallelBehaviour
when all its children are done.
WHEN_ANY
to terminate this ParallelBehaviour
when any of its child is done.
int
value n to terminate this
ParallelBehaviour
when n of its children are done.
ParallelBehaviour
setting the
owner agent.ParallelBehaviour
belongs to.ParallelBehaviour
. Use
WHEN_ALL
to terminate this ParallelBehaviour
when all its children are done.
WHEN_ANY
to terminate this ParallelBehaviour
when any of its child is done.
int
value n to terminate this
ParallelBehaviour
when n of its children are done.
onEnd()
) of the just executed child in the case this
child has completed (otherwise this parameter is meaningless)ParallelBehaviour
must terminate.onEnd()
) of the just executed child in the case this
child has completed (otherwise this parameter is meaningless)CompositeBehaviour
should terminate. false otherwise.ParallelBehaviour
ParallelBehaviour
that have already completed.ParallelBehaviour
ParallelBehaviour
ParallelBehaviour
back in initial state,
besides calling reset()
on each child behaviour
recursively.ParallelBehaviour
object is blocked
only when all its children behaviours are blocked and
becomes ready to run as soon as any of its children is
runnable. This method takes care of the various possibilities.
|