public class Capability
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected BeliefBase |
beliefBase |
protected java.lang.String |
id |
protected org.apache.commons.logging.Log |
log |
protected BDIAgent |
myAgent |
protected java.util.Set<Capability> |
partCapabilities |
protected PlanLibrary |
planLibrary |
protected Capability |
wholeCapability |
| Constructor and Description |
|---|
Capability()
Creates a new capability.
|
Capability(java.util.Set<Belief<?>> initialBeliefs,
java.util.Set<Plan> initialPlans)
Creates a new capability.
|
Capability(java.lang.String id)
Creates a new capability.
|
Capability(java.lang.String id,
Capability wholeCapability)
Creates a new capability.
|
Capability(java.lang.String id,
Capability wholeCapability,
java.util.Set<Belief<?>> initialBeliefs,
java.util.Set<Plan> initialPlans)
Creates a new capability.
|
Capability(java.lang.String id,
java.util.Set<Belief<?>> initialBeliefs,
java.util.Set<Plan> initialPlans)
Creates a new capability.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPartCapability(Capability partCapability) |
boolean |
canProcess(jade.lang.acl.ACLMessage msg)
Checks if this capability has a plan that can process the given message.
|
protected java.util.Set<GoalUpdateSet.GoalDescription> |
filter(java.util.Set<GoalUpdateSet.GoalDescription> goals)
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 goalUpdateSet)
This method is responsible for generating new goals or dropping existing
ones.
|
BeliefBase |
getBeliefBase() |
BeliefRevisionStrategy |
getBeliefRevisionStrategy() |
DeliberationFunction |
getDeliberationFunction() |
java.lang.String |
getId() |
BDIAgent |
getMyAgent() |
OptionGenerationFunction |
getOptionGenerationFunction() |
java.util.Set<Capability> |
getPartCapabilities() |
PlanLibrary |
getPlanLibrary() |
PlanSelectionStrategy |
getPlanSelectionStrategy() |
Capability |
getWholeCapability() |
boolean |
hasParts() |
boolean |
removePartCapability(Capability partCapability) |
protected void |
reviewBeliefs()
This method is responsible for reviewing beliefs from this agent.
|
protected Plan |
selectPlan(Goal goal,
java.util.Set<Plan> candidatePlans)
This method is responsible for selecting plans to achieve a goals of this
agent.
|
void |
setBeliefRevisionStrategy(BeliefRevisionStrategy beliefRevisionStrategy) |
void |
setDeliberationFunction(DeliberationFunction deliberationFunction) |
void |
setMyAgent(BDIAgent myAgent) |
void |
setOptionGenerationFunction(OptionGenerationFunction optionGenerationFunction) |
void |
setPlanSelectionStrategy(PlanSelectionStrategy planSelectionStrategy) |
protected void |
setup()
This is an empty holder for being overridden by subclasses.
|
java.lang.String |
toString() |
protected final BeliefBase beliefBase
protected final java.lang.String id
protected final org.apache.commons.logging.Log log
protected BDIAgent myAgent
protected final java.util.Set<Capability> partCapabilities
protected final PlanLibrary planLibrary
protected Capability wholeCapability
public Capability()
BeliefBase and
PlanLibrary as belief base and plan library respectively.public Capability(java.util.Set<Belief<?>> initialBeliefs, java.util.Set<Plan> initialPlans)
initialBeliefs - the initial set of beliefs to be added to the belief base of
this capability.initialPlans - the initial set of plans to be added to the plan library of
this capability.public Capability(java.lang.String id)
BeliefBase and
PlanLibrary as belief base and plan library respectively.id - the capability id. If it is null, the class name is going to
be used.public Capability(java.lang.String id,
Capability wholeCapability)
BeliefBase and
PlanLibrary as belief base and plan library respectively.id - the capability id. If it is null, the class name is going to
be used.wholeCapability - the whole-capability that this capability is part of.public Capability(java.lang.String id,
Capability wholeCapability,
java.util.Set<Belief<?>> initialBeliefs,
java.util.Set<Plan> initialPlans)
id - the capability id. If it is null, the class name is going to
be used.wholeCapability - the whole-capability that this capability is part of.initialBeliefs - the initial set of beliefs to be added to the belief base of
this capability.initialPlans - the initial set of plans to be added to the plan library of
this capability.public Capability(java.lang.String id,
java.util.Set<Belief<?>> initialBeliefs,
java.util.Set<Plan> initialPlans)
id - the capability id. If it is null, the class name is going to
be used.initialBeliefs - the initial set of beliefs to be added to the belief base of
this capability.initialPlans - the initial set of plans to be added to the plan library of
this capability.public void addPartCapability(Capability partCapability)
public boolean canProcess(jade.lang.acl.ACLMessage msg)
msg - the message to be checked.protected java.util.Set<GoalUpdateSet.GoalDescription> filter(java.util.Set<GoalUpdateSet.GoalDescription> goals)
protected void generateGoals(GoalUpdateSet goalUpdateSet)
public BeliefBase getBeliefBase()
public BeliefRevisionStrategy getBeliefRevisionStrategy()
public DeliberationFunction getDeliberationFunction()
public java.lang.String getId()
public BDIAgent getMyAgent()
public OptionGenerationFunction getOptionGenerationFunction()
public java.util.Set<Capability> getPartCapabilities()
public PlanLibrary getPlanLibrary()
public PlanSelectionStrategy getPlanSelectionStrategy()
public Capability getWholeCapability()
public boolean hasParts()
public boolean removePartCapability(Capability partCapability)
protected void reviewBeliefs()
protected Plan selectPlan(Goal goal, java.util.Set<Plan> candidatePlans)
goal - the goal to be achieved.capabilityPlans - the set of candidate plans of each capability.public void setBeliefRevisionStrategy(BeliefRevisionStrategy beliefRevisionStrategy)
beliefRevisionStrategy - the beliefRevisionStrategy to setpublic void setDeliberationFunction(DeliberationFunction deliberationFunction)
deliberationFunction - the deliberationFunction to setpublic void setMyAgent(BDIAgent myAgent)
myAgent - the myAgent to setpublic void setOptionGenerationFunction(OptionGenerationFunction optionGenerationFunction)
optionGenerationFunction - the optionGenerationFunction to setpublic void setPlanSelectionStrategy(PlanSelectionStrategy planSelectionStrategy)
planSelectionStrategy - the planSelectionStrategy to setprotected void setup()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()