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. This occurs during the agent reasoning cycle or when a goal is
dropped (BDIAgent.dropGoal(Goal)).| Constructor and Description |
|---|
Intention(Goal goal,
AbstractBDIAgent bdiAgent)
Creates a new intention.
|
Intention(Goal goal,
AbstractBDIAgent bdiAgent,
Capability dispatcher)
Creates a new intention.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGoalListener(GoalListener goalListener)
Adds a listener to be notified when about goal events.
|
void |
doWait()
Sets this intention to the
GoalStatus.WAITING status. |
Capability |
getDispatcher()
Returns the capability that dispatched this goal.
|
Goal |
getGoal()
Returns the goal associated with this intention.
|
java.util.List<GoalListener> |
getGoalListeners()
Returns all goal listeners.
|
AbstractBDIAgent |
getMyAgent()
Returns the agent associated with this intention.
|
java.util.Set<Capability> |
getOwners()
Returns the set of capabilities that own this goal.
|
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, so it will not be notified about the goal events
anymore.
|
void |
tryToAchive()
Makes this intention starts to try to achieve the goal.
|
public Intention(Goal goal, AbstractBDIAgent bdiAgent) throws java.lang.IllegalAccessException
goal - the goal to be achieved.bdiAgent - the bdiAgent associated with this intention.java.lang.IllegalAccessException - if the goal was dispatched by a capability that has no access
to the goal to be achieved.public Intention(Goal goal, AbstractBDIAgent bdiAgent, Capability dispatcher) throws java.lang.IllegalAccessException
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.dispatcher - the Capability that dispatched the goal.java.lang.IllegalAccessException - if the goal was dispatched by a capability that has no access
to the goal to be achieved.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 Capability getDispatcher()
public Goal getGoal()
public java.util.List<GoalListener> getGoalListeners()
public AbstractBDIAgent getMyAgent()
public java.util.Set<Capability> getOwners()
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.