public class SequentialActionPlanBody extends jade.core.behaviours.SequentialBehaviour implements PlanBody
AbstractPlanBody and
SequentialBehaviour.| Constructor and Description |
|---|
SequentialActionPlanBody() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
dispatchGoal(Goal goal)
Dispatches a goal to be achieved.
|
boolean |
dispatchSubgoal(Goal subgoal)
Dispatches a subgoal to be achieved.
|
boolean |
dispatchSubgoalAndListen(Goal subgoal)
Dispatches a subgoal to be achieved and registers itself as a listener to
receive a notification of the end of execution of the goal.
|
BeliefBase |
getBeliefBase()
Returns the belief base of the capability associated with the plan of
this plan body.
|
Capability |
getCapability()
Returns the capability associated with the plan of this plan body.
|
Plan.EndState |
getEndState()
Returns the end state of the execution of this plan.
|
Goal |
getGoal()
Returns the goal to be achieved by this plan body.
|
GoalEvent |
getGoalEvent()
Returns a goal event from the queue.
|
GoalEvent |
getGoalEvent(boolean block)
Returns a goal event from the queue.
|
GoalEvent |
getGoalEvent(long ms)
Returns a goal event from the queue.
|
Plan |
getPlan()
Returns the
Plan that is associated with this plan instance. |
void |
goalPerformed(GoalEvent event)
Notifies the listener that a goal that was performed.
|
void |
init(Plan plan,
Intention intention)
Initializes this plan body.
|
void |
start()
Starts the execution of a plan body, a
Behaviour, associated with
this plan. |
void |
stop()
Stops the plan body, a
Behaviour, associated with this plan. |
addSubBehaviour, checkTermination, getChildren, getCurrent, removeSubBehaviour, reset, scheduleFirst, scheduleNext, skipNextaction, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgentactionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, isRunnable, onEnd, onStart, restart, root, setBehaviourName, setDataStore, setExecutionStatepublic boolean dispatchGoal(Goal goal)
PlanBodydispatchGoal in interface PlanBodygoal - the goal to be dispatched.public boolean dispatchSubgoal(Goal subgoal)
PlanBodydispatchSubgoal in interface PlanBodysubgoal - the subgoal to be dispatched.public boolean dispatchSubgoalAndListen(Goal subgoal)
PlanBodydispatchSubgoalAndListen in interface PlanBodysubgoal - the subgoal to be dispatched.public BeliefBase getBeliefBase()
PlanBodygetBeliefBase in interface PlanBodypublic Capability getCapability()
PlanBodygetCapability in interface PlanBodypublic Plan.EndState getEndState()
PlanBodygetEndState in interface PlanBodypublic Goal getGoal()
PlanBodypublic GoalEvent getGoalEvent()
PlanBodygetGoalEvent in interface PlanBodypublic GoalEvent getGoalEvent(boolean block)
PlanBodygetGoalEvent in interface PlanBodyblock - true if the behavior must be blocked if the queue is empty.public GoalEvent getGoalEvent(long ms)
PlanBodygetGoalEvent in interface PlanBodyms - the maximum amount of time that the behavior must be blocked.public Plan getPlan()
PlanBodyPlan that is associated with this plan instance.public void goalPerformed(GoalEvent event)
GoalListenergoalPerformed in interface GoalListenerevent - the goal event that occurred.public void init(Plan plan, Intention intention) throws PlanInstantiationException
PlanBodyPlan) and an Intention. If this plan body has
already been initialized, this method throws a
PlanInstantiationException.init in interface PlanBodyplan - the plan associated this this plan body.intention - the intention that this plan instance have to achieve.PlanInstantiationException - if this plan body has already been initialized.public void start()
PlanBodyBehaviour, associated with
this plan.public void stop()
PlanBodyBehaviour, associated with this plan. If
the body implements the DisposablePlanBody, it invokes the method
to about the plan body, so it can perform finalizations.