public class BDIAgent
extends jade.core.Agent
Agent that has a current set of goals,
which are selected to become intentions, i.e. to tried to be achieved by
means of the selection and execution of plans. It also have a set of
Capability. It has a behavior that runs the BDI-interpreter. This
agent also have a MsgReceiver behavior to receive all messages that
the agent current plans can process.| Constructor and Description |
|---|
BDIAgent()
Default constructor.
|
BDIAgent(Capability capability)
Default constructor.
|
BDIAgent(Capability[] capabilities)
Default constructor.
|
BDIAgent(java.util.Collection<Capability> capabilities)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCapability(Capability capability)
Adds a capability to this agent.
|
void |
addGoal(Capability dispatcher,
Goal goal)
Adds a new goal to this agent to be achieved.
|
void |
addGoal(Capability dispatcher,
Goal goal,
GoalListener goalListener)
Adds a new goal to this agent to be achieved and adds a listener to
observe its end.
|
void |
addGoal(Goal goal)
Adds a new goal to this agent to be achieved.
|
void |
addGoal(Goal goal,
GoalListener goalListener)
Adds a new goal to this agent to be achieved and adds a listener to
observe its end.
|
void |
addSoftgoal(Softgoal softgoal)
Adds a new softgoal to this agent.
|
void |
dropGoal(Goal goal)
Drops a given goal of this agent.
|
void |
dropSoftoal(Softgoal softgoal)
Drops a given softgoal of this agent.
|
protected java.util.Set<GoalUpdateSet.GoalDescription> |
filter(java.util.Set<GoalUpdateSet.GoalDescription> agentGoals,
java.util.Map<Capability,java.util.Set<GoalUpdateSet.GoalDescription>> capabilityGoals)
This method is responsible for selecting a set of goals that must be
tried to be achieved (intentions) from the set of goals.
|
protected void |
generateGoals(GoalUpdateSet agentGoalUpdateSet,
java.util.Map<Capability,GoalUpdateSet> capabilityGoalUpdateSets)
This method is responsible for generating new goals or dropping existing
ones.
|
java.util.Set<Capability> |
getAggregatedCapabilities()
Returns the root capability of this agent.
|
java.util.Collection<Belief<?>> |
getAllBeliefs()
Returns a collection of all beliefs from all capabilities of this agent.
|
java.util.Collection<Capability> |
getAllCapabilities() |
java.util.Set<Goal> |
getAllGoals()
Gets all goals of this agent.
|
java.util.Set<Softgoal> |
getAllSoftgoals()
Gets all softgoals of this agent.
|
java.util.Set<Intention> |
getIntentions() |
protected void |
init()
This method initializes the BDI agent.
|
boolean |
removeCapability(Capability capability)
Removes a capability from this agent.
|
protected void |
reviewBeliefs()
This method is responsible for reviewing beliefs from this agent.
|
protected Plan |
selectPlan(Goal goal,
java.util.Map<Capability,java.util.Set<Plan>> capabilityPlans)
This method is responsible for selecting plans to achieve a goals of this
agent.
|
protected void |
setup()
Initializes the BDI agent.
|
protected void |
takeDown() |
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, writepublic BDIAgent()
public BDIAgent(Capability capability)
public BDIAgent(Capability[] capabilities)
public BDIAgent(java.util.Collection<Capability> capabilities)
public void addCapability(Capability capability)
capability - capability to be added.public void addGoal(Capability dispatcher, Goal goal)
dispatcher - the Capability that dispatched this goal.goal - the goal to be achieved.public void addGoal(Capability dispatcher, Goal goal, GoalListener goalListener)
dispatcher - the Capability that dispatched this goal.goal - the goal to be achieved.goalListener - the listener to be notified.public void addGoal(Goal goal)
goal - the goal to be achieved.public void addGoal(Goal goal, GoalListener goalListener)
goal - the goal to be achieved.goalListener - the listener to be notified.public void addSoftgoal(Softgoal softgoal)
softgoal - the softgoal to be pursued.public void dropGoal(Goal goal)
goal - the goal to be dropped.public void dropSoftoal(Softgoal softgoal)
softgoal - the softgoal to be dropped.protected java.util.Set<GoalUpdateSet.GoalDescription> filter(java.util.Set<GoalUpdateSet.GoalDescription> agentGoals, java.util.Map<Capability,java.util.Set<GoalUpdateSet.GoalDescription>> capabilityGoals)
protected void generateGoals(GoalUpdateSet agentGoalUpdateSet, java.util.Map<Capability,GoalUpdateSet> capabilityGoalUpdateSets)
public java.util.Set<Capability> getAggregatedCapabilities()
public java.util.Collection<Belief<?>> getAllBeliefs()
public java.util.Collection<Capability> getAllCapabilities()
public java.util.Set<Goal> getAllGoals()
public java.util.Set<Softgoal> getAllSoftgoals()
public java.util.Set<Intention> getIntentions()
protected void init()
setup() method.public boolean removeCapability(Capability capability)
capability - capability to be removed.protected void reviewBeliefs()
protected Plan selectPlan(Goal goal, java.util.Map<Capability,java.util.Set<Plan>> capabilityPlans)
goal - the goal to be achieved.capabilityPlans - the set of candidate plans of each capability.protected final void setup()
BDIInterpreter behavior as well..setup in class jade.core.AgentAgent.setup()protected void takeDown()
takeDown in class jade.core.AgentAgent.takeDown()