|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.pucrio.inf.les.bdijade.core.Intention
public class Intention
This class represents the intention abstraction from the BDI model. It
represents a goal that the agent is committed to achieve. It has the
associated goal and tries to execute plans to achieve it. It keeps a list of
the executed plans, and after using all plans unsuccessfully, the goal is
considered unachievable. When a plan fails, the BDI-interpreter cycle may
invoke the tryToAchive() method again, so the intention tries
another plan. During its execution, the intention can be set to no longer
desired.
| Field Summary | |
|---|---|
private PlanInstance |
currentPlan
|
private java.util.Set<Plan> |
executedPlans
|
private Goal |
goal
|
private java.util.List<GoalListener> |
goalListeners
|
private org.apache.commons.logging.Log |
log
|
private BDIAgent |
myAgent
|
private boolean |
noLongerDesired
|
private Capability |
owner
|
private boolean |
unachievable
|
private boolean |
waiting
|
| Constructor Summary | |
|---|---|
Intention(BDIAgent bdiAgent,
Goal goal)
Creates a new intention. |
|
Intention(Goal goal,
BDIAgent bdiAgent,
Capability owner)
Creates a new intention. |
|
| Method Summary | |
|---|---|
void |
addGoalListener(GoalListener goalListener)
Adds a listener to be notified when the given has achieve its end state. |
protected void |
dispatchPlan()
Dispatches a new plan to try to achieve the intention goal. |
void |
doWait()
Sets this intention to the GoalStatus.WAITING status. |
private void |
fireGoalEvent(GoalEvent goalEvent)
Notify all listeners, if any, about a goal event. |
void |
fireGoalFinishedEvent()
Fires a goal event when a goal has achieved its end state. |
private java.util.Set<Plan> |
getCanAchievePlans()
Returns all plans from all capabilities that can achieve the goal. |
Goal |
getGoal()
|
java.util.List<GoalListener> |
getGoalListeners()
|
BDIAgent |
getMyAgent()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PlanInstance currentPlan
private final java.util.Set<Plan> executedPlans
private final Goal goal
private final java.util.List<GoalListener> goalListeners
private final org.apache.commons.logging.Log log
private final BDIAgent myAgent
private boolean noLongerDesired
private Capability owner
private boolean unachievable
private boolean waiting
| Constructor Detail |
|---|
public Intention(BDIAgent bdiAgent,
Goal goal)
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.| Method Detail |
|---|
public void addGoalListener(GoalListener goalListener)
goalListener - the listener to be notified.protected void dispatchPlan()
public void doWait()
GoalStatus.WAITING status. It may come
from the GoalStatus.PLAN_FAILED or
GoalStatus.TRYING_TO_ACHIEVE states.
private void fireGoalEvent(GoalEvent goalEvent)
goalEvent - public void fireGoalFinishedEvent()
GoalStatusprivate java.util.Set<Plan> getCanAchievePlans()
public Goal getGoal()
public java.util.List<GoalListener> getGoalListeners()
public BDIAgent getMyAgent()
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||