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.
|
BeliefBase |
getBeliefBase() |
java.lang.String |
getId() |
BDIAgent |
getMyAgent() |
java.util.Set<Capability> |
getPartCapabilities() |
PlanLibrary |
getPlanLibrary() |
Capability |
getWholeCapability() |
boolean |
hasParts() |
boolean |
removePartCapability(Capability partCapability) |
void |
reviewBeliefs()
This method is an empty place holder for subclasses.
|
void |
setMyAgent(BDIAgent myAgent) |
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.public BeliefBase getBeliefBase()
public java.lang.String getId()
public BDIAgent getMyAgent()
public java.util.Set<Capability> getPartCapabilities()
public PlanLibrary getPlanLibrary()
public Capability getWholeCapability()
public boolean hasParts()
public boolean removePartCapability(Capability partCapability)
public void reviewBeliefs()
public void setMyAgent(BDIAgent myAgent)
myAgent - the myAgent to setprotected void setup()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()