public abstract class AbstractPlanBody extends jade.core.behaviours.Behaviour implements PlanBody
| Constructor and Description |
|---|
AbstractPlanBody()
Creates a new plan body instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispatchGoal(Goal goal)
Dispatches a goal to be achieved.
|
void |
dispatchProtectedGoal(Goal goal)
Dispatches a goal to be achieved, using the capability (or its children
capabilities) associated with the plan.
|
void |
dispatchProtectedSubgoal(Goal subgoal)
Dispatches a subgoal to be achieved, using the capability (or its
children capabilities) associated with the plan.
|
void |
dispatchProtectedSubgoalAndListen(Goal subgoal)
Dispatches a subgoal to be achieved, using the capability (or its
children capabilities) associated with the plan, and registers itself as
a listener to receive a notification of the end of execution of the goal.
|
void |
dispatchSubgoal(Goal subgoal)
Dispatches a subgoal to be achieved.
|
void |
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.
|
boolean |
done() |
BeliefBase |
getBeliefBase()
Returns the belief base of the capability.
|
Plan.EndState |
getEndState()
Returns the end state of plan.
|
Goal |
getGoal()
Returns the goal to be achieved by this plan instance.
|
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.
|
protected void |
setEndState(Plan.EndState endState) |
void |
start()
Starts the plan body, a
Behaviour, associated with this plan. |
void |
stop()
Stops the plan body, a
Behaviour, associated with this plan. |
action, actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onEnd, onStart, reset, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionStatepublic void dispatchGoal(Goal goal)
dispatchGoal in interface PlanBodygoal - the goal to be dispatched.public void dispatchProtectedGoal(Goal goal)
dispatchProtectedGoal in interface PlanBodygoal - the goal to be dispatched.public void dispatchProtectedSubgoal(Goal subgoal)
dispatchProtectedSubgoal in interface PlanBodysubgoal - the subgoal to be dispatched.public void dispatchProtectedSubgoalAndListen(Goal subgoal)
dispatchProtectedSubgoalAndListen in interface PlanBodysubgoal - the subgoal to be dispatched.public void dispatchSubgoal(Goal subgoal)
dispatchSubgoal in interface PlanBodysubgoal - the subgoal to be dispatched.public void dispatchSubgoalAndListen(Goal subgoal)
dispatchSubgoalAndListen in interface PlanBodysubgoal - the subgoal to be dispatched.public final boolean done()
done in class jade.core.behaviours.Behaviourpublic BeliefBase getBeliefBase()
getBeliefBase in interface PlanBodypublic Plan.EndState getEndState()
OutputPlanBody interface (this is invoked only
once). If the plan body has come to an end state, it sets all of its
subgoals as no longer desired, in case they are still trying to be
achieved.getEndState in interface PlanBodypublic final Goal getGoal()
public GoalEvent getGoalEvent()
getGoalEvent in interface PlanBodypublic GoalEvent getGoalEvent(boolean block)
getGoalEvent in interface PlanBodyblock - true if the behavior must be blocked if the queue is empty.public GoalEvent getGoalEvent(long ms)
getGoalEvent in interface PlanBodyms - the maximum amount of time that the behavior must be blocked.public void goalPerformed(GoalEvent event)
GoalListenergoalPerformed in interface GoalListenerevent - the goal event that occurred.GoalListener.goalPerformed(bdi4jade.event.GoalEvent)public final void init(Plan plan, Intention intention) throws PlanInstantiationException
Plan) and an Intention. If this plan body has
already been initialized, this method throws a
PlanInstantiationException. It also sets up the plan input
parameters based on the goal input parameters.init in interface PlanBodyplan - the plan associated this this plan body.intention - the intention that this plan instance have to achieve.PlanBodyInstantiationException - if this plan body has already been initialized.PlanInstantiationExceptionprotected final void setEndState(Plan.EndState endState)
endState - the endState to setpublic final void start()
Behaviour, associated with this plan.public final void stop()
Behaviour, associated with this plan. If
the body implements the DisposablePlanBody, it invokes the method
to about the plan body, so it can perform finalizations.