public class PlanLibrary
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
PlanLibrary()
Creates a plan library.
|
PlanLibrary(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 |
|---|---|
void |
addPlan(Plan plan)
Adds a plan to the plan library.
|
java.util.Set<Plan> |
canAchievePlans(Goal goal)
Returns the set of plans that can achieve the given goal.
|
boolean |
canProcessPlans(jade.lang.acl.ACLMessage message)
Returns true if there is a plan that can process the given message.
|
Capability |
getCapability() |
java.util.Set<Plan> |
getPlans() |
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.
|
void |
setCapability(Capability capability)
Sets the capability of this plan library.
|
public PlanLibrary()
public PlanLibrary(java.util.Set<Plan> plans)
plans - the initial planspublic void addPlan(Plan plan)
plan - the plan to be added.public java.util.Set<Plan> canAchievePlans(Goal goal)
goal - the goal to be achieved.public boolean canProcessPlans(jade.lang.acl.ACLMessage message)
message - the message to be processed.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.public void setCapability(Capability capability)
RuntimeException. After setting the capability,
the init() method is invoked.capability - the capability to set