public abstract class AbstractBDIAgent extends jade.core.Agent implements BDIAgent
BDIAgent interface.
It is an extension of Agent. It also has a set of Capability
- an agent is an aggregation of capabilities, and a MsgReceiver
behavior to receive all messages that the agent current plans can process.| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<GoalListener> |
goalListeners |
| Constructor and Description |
|---|
AbstractBDIAgent()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGoal(Capability dispatcher,
Goal goal)
Adds a new goal to this agent to be achieved.
|
boolean |
addGoal(Capability dispatcher,
Goal goal,
GoalListener goalListener)
Adds a new goal to this agent to be achieved and adds a listener to
observe events related to this goal.
|
boolean |
addGoal(Goal goal)
Adds a new goal to this agent to be achieved.
|
boolean |
addGoal(Goal goal,
GoalListener goalListener)
Adds a new goal to this agent to be achieved and adds a listener to
observe events related to this goal.
|
void |
addGoalListener(GoalListener goalListener)
Adds a listener to be notified when about goal events.
|
void |
addSoftgoal(Softgoal softgoal)
Adds a new softgoal to this agent.
|
boolean |
canHandle(jade.lang.acl.ACLMessage msg)
Checks if this agent is able to process the given message.
|
void |
dropGoal(Goal goal)
Drops a given goal of this agent, which means setting it as no longer
desired.
|
void |
dropSoftoal(Softgoal softgoal)
Drops a given softgoal of this agent.
|
java.util.Collection<Capability> |
getAllCapabilities()
Returns all capabilities that are part of this agent.
|
AgentBeliefRevisionStrategy |
getBeliefRevisionStrategy()
Returns the belief revision strategy of this agent.
|
java.util.Collection<Belief<?,?>> |
getBeliefs()
Returns a collection of all beliefs from all capabilities of this agent.
|
java.util.Set<Capability> |
getCapabilities()
Returns the capabilities of this agent.
|
AgentDeliberationFunction |
getDeliberationFunction()
Returns the deliberation function of this agent.
|
java.util.List<GoalListener> |
getGoalListeners()
Returns all goal listeners.
|
protected java.util.Set<Capability> |
getGoalOwner(java.lang.Class<? extends Capability> owner,
boolean internal)
Returns the capability instances that owns a dispatched goal, considering
the aggregated capabilities of this agent.
|
java.util.Set<Goal> |
getGoals()
Gets all goals of this agent.
|
java.util.Set<Intention> |
getIntentions()
Returns all agent intentions, which are goals that this agent is
committed to achieve.
|
AgentOptionGenerationFunction |
getOptionGenerationFunction()
Returns the option generation function of this agent.
|
AgentPlanSelectionStrategy |
getPlanSelectionStrategy()
Returns the plan selection strategy of this agent.
|
java.util.Set<Softgoal> |
getSoftgoals()
Gets all softgoals of this agent.
|
boolean |
hasGoal(Goal goal)
Checks if this agent has a given goal.
|
protected void |
init()
This method initializes the BDI agent.
|
void |
removeGoalListener(GoalListener goalListener)
Removes a goal listener, so it will not be notified about the goal events
anymore.
|
void |
restart()
Restarts the agent in case its reasoning cycle is in the blocked state.
|
void |
setBeliefRevisionStrategy(AgentBeliefRevisionStrategy beliefRevisionStrategy)
Sets the belief revision strategy of this agent.
|
void |
setDeliberationFunction(AgentDeliberationFunction deliberationFunction)
Sets the deliberation function of this agent.
|
void |
setOptionGenerationFunction(AgentOptionGenerationFunction optionGenerationFunction)
Sets the option generation function of this agent.
|
void |
setPlanSelectionStrategy(AgentPlanSelectionStrategy planSelectionStrategy)
Sets the plan selection strategy of this agent.
|
protected void |
setup()
Initializes the BDI agent.
|
protected void |
takeDown()
Removes all capabilities of this agent, before it stops its execution.
|
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, createMessageQueue, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AInterface, getO2AObject, getProperty, getQueueSize, getState, here, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, registerO2AInterface, removeBehaviour, removeTimer, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setO2AManager, setQueueSize, waitUntilStarted, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblockingReceive, blockingReceive, blockingReceive, blockingReceive, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getContainerController, getContentManager, getCurQueueSize, getHap, getHelper, getLocalName, getName, getQueueSize, here, putBack, receive, receive, send, setQueueSizeprotected final java.util.List<GoalListener> goalListeners
public final boolean addGoal(Capability dispatcher, Goal goal)
BDIAgentaddGoal in interface BDIAgentdispatcher - the capability that dispatched this goal.goal - the goal to be achieved.BDIAgent.addGoal(bdi4jade.core.Capability,
bdi4jade.goal.Goal)public final boolean addGoal(Capability dispatcher, Goal goal, GoalListener goalListener)
BDIAgentaddGoal in interface BDIAgentdispatcher - the Capability that dispatched this goal.goal - the goal to be achieved.goalListener - the listener to be notified about this goal events.BDIAgent.addGoal(bdi4jade.core.Capability,
bdi4jade.goal.Goal, bdi4jade.event.GoalListener)public final boolean addGoal(Goal goal)
BDIAgentaddGoal in interface BDIAgentgoal - the goal to be achieved.BDIAgent.addGoal(bdi4jade.goal.Goal)public final boolean addGoal(Goal goal, GoalListener goalListener)
BDIAgentaddGoal in interface BDIAgentgoal - the goal to be achieved.goalListener - the listener to be notified.BDIAgent.addGoal(bdi4jade.goal.Goal,
bdi4jade.event.GoalListener)public final void addGoalListener(GoalListener goalListener)
BDIAgentaddGoalListener in interface BDIAgentgoalListener - the listener to be notified.BDIAgent.addGoalListener(bdi4jade.event.GoalListener)public final void addSoftgoal(Softgoal softgoal)
BDIAgentaddSoftgoal in interface BDIAgentsoftgoal - the softgoal to be pursued.BDIAgent.addSoftgoal(bdi4jade.goal.Softgoal)public boolean canHandle(jade.lang.acl.ACLMessage msg)
BDIAgentcanHandle in interface BDIAgentmsg - the message to be checked.BDIAgent.canHandle(jade.lang.acl.ACLMessage)public final void dropGoal(Goal goal)
BDIAgentdropGoal in interface BDIAgentgoal - the goal to be dropped.BDIAgent.dropGoal(bdi4jade.goal.Goal)public final void dropSoftoal(Softgoal softgoal)
BDIAgentdropSoftoal in interface BDIAgentsoftgoal - the softgoal to be dropped.BDIAgent.dropSoftoal(bdi4jade.goal.Softgoal)public final java.util.Collection<Capability> getAllCapabilities()
BDIAgentgetAllCapabilities in interface BDIAgentBDIAgent.getAllCapabilities()public final AgentBeliefRevisionStrategy getBeliefRevisionStrategy()
BDIAgentgetBeliefRevisionStrategy in interface BDIAgentBDIAgent.getBeliefRevisionStrategy()public final java.util.Collection<Belief<?,?>> getBeliefs()
BDIAgentgetBeliefs in interface BDIAgentBDIAgent.getBeliefs()public final java.util.Set<Capability> getCapabilities()
BDIAgentgetCapabilities in interface BDIAgentBDIAgent.getCapabilities()public final AgentDeliberationFunction getDeliberationFunction()
BDIAgentgetDeliberationFunction in interface BDIAgentBDIAgent.getDeliberationFunction()public final java.util.List<GoalListener> getGoalListeners()
BDIAgentgetGoalListeners in interface BDIAgentBDIAgent.getGoalListeners()protected final java.util.Set<Capability> getGoalOwner(java.lang.Class<? extends Capability> owner, boolean internal)
owner - the capability class that is the goal owner.internal - a boolean indicated whether the goal is internal. It is true
if the goal is internal, false otherwise.public final java.util.Set<Goal> getGoals()
BDIAgentgetGoals in interface BDIAgentBDIAgent.getGoals()public final java.util.Set<Intention> getIntentions()
BDIAgentgetIntentions in interface BDIAgentBDIAgent.getIntentions()public final AgentOptionGenerationFunction getOptionGenerationFunction()
BDIAgentgetOptionGenerationFunction in interface BDIAgentBDIAgent.getOptionGenerationFunction()public final AgentPlanSelectionStrategy getPlanSelectionStrategy()
BDIAgentgetPlanSelectionStrategy in interface BDIAgentBDIAgent.getPlanSelectionStrategy()public final java.util.Set<Softgoal> getSoftgoals()
BDIAgentgetSoftgoals in interface BDIAgentBDIAgent.getSoftgoals()public boolean hasGoal(Goal goal)
BDIAgenthasGoal in interface BDIAgentgoal - the goal to be checked.BDIAgent.hasGoal(bdi4jade.goal.Goal)protected void init()
setup() method. This is an empty method that should be overriden
by subclasses.public final void removeGoalListener(GoalListener goalListener)
BDIAgentremoveGoalListener in interface BDIAgentgoalListener - the goal listener to be removed.BDIAgent.removeGoalListener(bdi4jade.event.GoalListener)public final void restart()
BDIAgentrestart in interface BDIAgentBDIAgent.restart()public final void setBeliefRevisionStrategy(AgentBeliefRevisionStrategy beliefRevisionStrategy)
beliefRevisionStrategy - the beliefRevisionStrategy to set.public final void setDeliberationFunction(AgentDeliberationFunction deliberationFunction)
deliberationFunction - the deliberationFunction to set.public final void setOptionGenerationFunction(AgentOptionGenerationFunction optionGenerationFunction)
optionGenerationFunction - the optionGenerationFunction to set.public final void setPlanSelectionStrategy(AgentPlanSelectionStrategy planSelectionStrategy)
planSelectionStrategy - the planSelectionStrategy to set.protected final void setup()
BDIInterpreter behavior as well. It invokes the init()
method, so that customized initializations can be perfomed by subclasses.setup in class jade.core.AgentAgent.setup()protected void takeDown()
takeDown in class jade.core.AgentAgent.takeDown()