public class PlanLibrary
extends java.lang.Object
implements java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
PlanLibrary()
The default constructor.
|
|
PlanLibrary(Capability capability)
Creates a plan library associated with a capability.
|
|
PlanLibrary(Capability capability,
java.util.Set<Plan> plans)
Creates a plan library base associated with a capability and adds the
plans in the provided set.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDefaultPlans()
Adds a set of default plans to this library.
|
void |
addPlan(Plan plan)
Adds a plan to the plan library.
|
boolean |
canAchieve(Goal goal)
Returns true if there is a plan that can achieve the given goal.
|
boolean |
canHandle(jade.lang.acl.ACLMessage message)
Returns true if there is a plan that can handle the given message.
|
java.util.Set<Plan> |
getCandidatePlans(Goal goal)
Returns the set of plans that can achieve the given goal.
|
Capability |
getCapability()
Returns the capability with which this plan library is associated.
|
java.util.Set<Plan> |
getPlans()
Returns the set of plans that are part of this plan library.
|
boolean |
hasPlan(Plan plan)
Checks if a plan is part of the plan library.
|
boolean |
removePlan(Plan plan)
Removes a plan from the plan library.
|
protected PlanLibrary()
public PlanLibrary(Capability capability)
capability - the capability with which this plan library is associated.public PlanLibrary(Capability capability, java.util.Set<Plan> plans)
capability - the capability with which this plan library is associated.plans - the initial plansprotected void addDefaultPlans()
public void addPlan(Plan plan)
plan - the plan to be added.public boolean canAchieve(Goal goal)
goal - the goal to be checked.public boolean canHandle(jade.lang.acl.ACLMessage message)
message - the message to be checked.public java.util.Set<Plan> getCandidatePlans(Goal goal)
goal - the goal to be achieved.public Capability getCapability()
public java.util.Set<Plan> getPlans()
public boolean hasPlan(Plan plan)
plan - the plan to be checkedpublic boolean removePlan(Plan plan)
plan - the plan to be removed.