|
Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour |
Behaviour.RunnableChangedEvent |
Field Summary | ||
protected String |
currentName | |
protected jade.util.leap.List |
lastStates |
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 | ||
FSMBehaviour() Default constructor, does not set the owner agent. |
||
FSMBehaviour(Agent a) This constructor sets the owner agent. |
Method Summary | ||
protected boolean |
checkTermination(boolean currentDone, int currentResult) Check whether this FSMBehaviour must terminate. |
|
void |
deregisterDefaultTransition(String source) Deregister the default transition from a given source state. |
|
deregisterState(String name) Deregister a state of this FSMBehaviour . |
||
void |
deregisterTransition(String source, int event) Deregister the transition from a given source state and identfied by a given termination event. |
|
protected void |
forceTransitionTo(String next) Temporarily disregards the FSM structure, and jumps to the given state. |
|
jade.util.leap.Collection |
getChildren() Return a Collection view of the children of this SequentialBehaviour |
|
protected Behaviour |
getCurrent() Get the current child |
|
int |
getLastExitValue() Retrieve the exit value of the most recently executed child. |
|
String |
getName(Behaviour state) Retrieve the name of the FSM state associated to the given child behaviour. |
|
protected Behaviour |
getPrevious() Get the previously executed child |
|
getState(String name) Retrieve the child behaviour associated to the FSM state with the given name. |
||
protected void |
handleInconsistentFSM(String current, int event) | |
protected void |
handleStateEntered(Behaviour state) | |
boolean |
hasDefaultTransition(String source) Check if a default transition exits from a given source state. |
|
int |
onEnd() Override the onEnd() method to return the exit value of the last executed state. |
|
void |
registerDefaultTransition(String s1, String s2) Register a default transition in the FSM defining the policy for children scheduling of this FSMBehaviour . |
|
void |
registerDefaultTransition(String s1, String s2, String[] toBeReset) Register a default transition in the FSM defining the policy for children scheduling of this FSMBehaviour . |
|
void |
registerFirstState(Behaviour state, String name) Register a Behaviour as the initial state of this FSMBehaviour . |
|
void |
registerLastState(Behaviour state, String name) Register a Behaviour as a final state of this FSMBehaviour . |
|
void |
registerState(Behaviour state, String name) Register a Behaviour as a state of this FSMBehaviour . |
|
void |
registerTransition(String s1, String s2, int event) Register a transition in the FSM defining the policy for children scheduling of this FSMBehaviour . |
|
void |
registerTransition(String s1, String s2, int event, String[] toBeReset) Register a transition in the FSM defining the policy for children scheduling of this FSMBehaviour . |
|
void |
reset() Put this FSMBehaviour back in the initial condition. |
|
void |
resetStates(String[] states) Reset the children behaviours registered in the states indicated in the states parameter. |
|
protected void |
scheduleFirst() Prepare the first child for execution. |
|
protected void |
scheduleNext(boolean currentDone, int currentResult) This method schedules the next child to be executed. |
|
String |
stringifyTransitionTable() |
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, onStart, restart, root, setBehaviourName, setDataStore, setExecutionState |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Behaviour
as a state of this
FSMBehaviour
. When the FSM reaches this state
the registered Behaviour
will be executed.Behaviour
representing the stateBehaviour
as the initial state of this
FSMBehaviour
.Behaviour
representing the stateBehaviour
as a final state of this
FSMBehaviour
. When the FSM reaches this state
the registered Behaviour
will be executed and,
when completed, the FSMBehaviour
will terminate too.Behaviour
representing the stateFSMBehaviour
.FSMBehaviour
.onEnd()
method of the
Behaviour
representing state s1.FSMBehaviour
.
When this transition is fired the states indicated in the
toBeReset
parameter are reset. This is
particularly useful for transitions that lead to states that
have already been visited.onEnd()
method of the
Behaviour
representing state s1.FSMBehaviour
.
This transition will be fired when state s1 terminates with
an event that is not explicitly associated to any transition.FSMBehaviour
.
This transition will be fired when state s1 terminates with
an event that is not explicitly associated to any transition.
When this transition is fired the states indicated in the
toBeReset
parameter are reset. This is
particularly useful for transitions that lead to states that
have already been visited.true
if a default transition exits from the given source state. false
otherwise.Behaviour
representing the state whose
name is name
, or null
if no such
behaviour exists.Behaviour
state, or null
if the given
behaviour is not a child of this FSM behaviour.Behaviour
registered as the first state of this
FSMBehaviour
onEnd()
) of the just executed child in the case this
child has completed (otherwise this parameter is meaningless)FSMBehaviour
must terminate.onEnd()
) of the just executed child in the case this
child has completed (otherwise this parameter is meaningless)SequentialBehaviour
GOTO
statement
between states, and replaces the currently active state without
considering the trigger event or whether a transition was
registered. It should be used only to handle exceptional
conditions, if default transitions are not effective enough.states
parameter.
|