public class Intention
extends java.lang.Object
tryToAchive() method again, so the intention tries
another plan. During its execution, the intention can be set to no longer
desired.| Constructor and Description |
|---|
Intention(Goal goal,
BDIAgent bdiAgent)
Creates a new intention.
|
Intention(Goal goal,
BDIAgent bdiAgent,
Capability owner)
Creates a new intention.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGoalListener(GoalListener goalListener)
Adds a listener to be notified when the given has achieve its end state.
|
void |
doWait()
Sets this intention to the
GoalStatus.WAITING status. |
void |
fireGoalFinishedEvent()
Fires a goal event when a goal has achieved its end state.
|
Goal |
getGoal() |
java.util.List<GoalListener> |
getGoalListeners() |
BDIAgent |
getMyAgent() |
Capability |
getOwner() |
GoalStatus |
getStatus()
Returns the current goal status that this capability is committed to
achieve.
|
void |
noLongerDesire()
Sets this intention as no longer desired.
|
void |
removeGoalListener(GoalListener goalListener)
Removes a goal listener to not be notified about the goal achievement
anymore.
|
void |
tryToAchive()
Makes this intention starts to try to achieve the goal.
|
public Intention(Goal goal, BDIAgent bdiAgent)
goal - the goal to be achieved.bdiAgent - the bdiAgent associated with this intention.public Intention(Goal goal, BDIAgent bdiAgent, Capability owner)
Capability as
parameter indicating the owner of the goal (dispatched the goal).goal - the goal to be achieved.bdiAgent - the bdiAgent associated with this intention.owner - the Capability that is owner of the goal.public void addGoalListener(GoalListener goalListener)
goalListener - the listener to be notified.public void doWait()
GoalStatus.WAITING status. It may come
from the GoalStatus.PLAN_FAILED or
GoalStatus.TRYING_TO_ACHIEVE states.public void fireGoalFinishedEvent()
GoalStatuspublic Goal getGoal()
public java.util.List<GoalListener> getGoalListeners()
public BDIAgent getMyAgent()
public Capability getOwner()
public GoalStatus getStatus()
GoalStatuspublic void noLongerDesire()
GoalStatus.WAITING,
GoalStatus.PLAN_FAILED or GoalStatus.TRYING_TO_ACHIEVE to
GoalStatus.NO_LONGER_DESIRED.public void removeGoalListener(GoalListener goalListener)
goalListener - the goal listener to be removed.public void tryToAchive()
GoalStatus.WAITING or
GoalStatus.PLAN_FAILED to GoalStatus.TRYING_TO_ACHIEVE.