public class SequentialGoalPlanBody extends AbstractPlanBody implements OutputPlanBody
SequentialGoal.| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Goal> |
completedGoals |
protected Goal |
currentGoal |
protected GoalEvent |
failedGoal |
protected java.util.Iterator<Goal> |
it |
| Constructor and Description |
|---|
SequentialGoalPlanBody() |
| Modifier and Type | Method and Description |
|---|---|
void |
action()
This method tries to achieve all subgoals of the
SequentialGoal
to be achieved sequentially. |
void |
onStart()
Initializes this plan.
|
void |
setGoalOutput(Goal goal)
Sets completed goals, and the failed goal, if there is one.
|
protected void |
setNextGoal(Goal previousGoal,
Goal goal)
Sets the parameters of the next goal to be executed based on the previous
goal execution.
|
dispatchGoal, dispatchSubgoal, dispatchSubgoalAndListen, done, getBeliefBase, getCapability, getEndState, getGoal, getGoalEvent, getGoalEvent, getGoalEvent, getPlan, goalPerformed, init, setEndState, start, stopactionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onEnd, reset, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionStateprotected java.util.List<Goal> completedGoals
protected Goal currentGoal
protected GoalEvent failedGoal
protected java.util.Iterator<Goal> it
public void action()
SequentialGoal
to be achieved sequentially. If one of the subgoals fail, it stops the
plan body execution.action in class jade.core.behaviours.BehaviourBehaviour.action()public void onStart()
SequentialGoal. If
not, it throws an IllegalArgumentException.public void setGoalOutput(Goal goal)
setGoalOutput in interface OutputPlanBodygoal - the goal whose output parameters are to be set.OutputPlanBody.setGoalOutput(bdi4jade.goal.Goal)protected void setNextGoal(Goal previousGoal, Goal goal) throws ParameterException
Parameter annotation.previousGoal - the previously executed goal.goal - the goal that is going to be dispatched.ParameterException - if an error occurred during setting up the next goal.