|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.pucrio.inf.les.bdijade.util.MetadataElement
br.pucrio.inf.les.bdijade.plan.Plan
public abstract class Plan
This class represents the plan abstraction. It defines the goals that the plan can achieve, in which context, and knows which is its plan body.
| Field Summary | |
|---|---|
private java.util.Set<java.lang.Class<? extends Goal>> |
goals
|
protected java.lang.String |
id
|
private java.util.Set<jade.lang.acl.MessageTemplate> |
messageTemplates
|
private PlanLibrary |
planLibrary
|
| Fields inherited from class br.pucrio.inf.les.bdijade.util.MetadataElement |
|---|
metadata |
| Constructor Summary | |
|---|---|
Plan(java.lang.String id)
Constructs a new Plan. |
|
Plan(java.lang.String id,
java.lang.Class<? extends Goal> goalClass)
Constructs a new Plan. |
|
Plan(java.lang.String id,
java.lang.Class<? extends Goal> goalClass,
jade.lang.acl.MessageTemplate messageTemplate)
Constructs a new Plan. |
|
Plan(java.lang.String id,
jade.lang.acl.MessageTemplate messageTemplate)
Constructs a new Plan. |
|
| Method Summary | |
|---|---|
void |
addGoal(java.lang.Class<? extends Goal> goalClass)
Adds a goal class that this plan may achieve. |
void |
addMessageTemplate(jade.lang.acl.MessageTemplate messageTemplate)
Adds a message template of messages that this plan can process. |
boolean |
canAchieve(Goal goal)
Verifies if a given goal can be achieved by this plan. |
boolean |
canProcess(jade.lang.acl.ACLMessage message)
Verifies if the message received matches with any of the message templates of this plan. |
abstract jade.core.behaviours.Behaviour |
createPlanBody()
Instantiate the plan body of this plan. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getId()
|
PlanLibrary |
getPlanLibrary()
|
int |
hashCode()
|
protected void |
initGoals()
This method is invoked in the Plan constructor. |
protected void |
initMessageTemplates()
This method is invoked in the Plan constructor. |
protected boolean |
matchesContext(Goal goal)
Verifies that this plan can be executed in the current context. |
void |
setPlanLibrary(PlanLibrary planLibrary)
|
java.lang.String |
toString()
|
| Methods inherited from class br.pucrio.inf.les.bdijade.util.MetadataElement |
|---|
getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final java.util.Set<java.lang.Class<? extends Goal>> goals
protected final java.lang.String id
private final java.util.Set<jade.lang.acl.MessageTemplate> messageTemplates
private PlanLibrary planLibrary
| Constructor Detail |
|---|
public Plan(java.lang.String id)
id - plan identifier
public Plan(java.lang.String id,
java.lang.Class<? extends Goal> goalClass)
id - plan identifiergoalClass - the goal that this plan can achieve
public Plan(java.lang.String id,
java.lang.Class<? extends Goal> goalClass,
jade.lang.acl.MessageTemplate messageTemplate)
id - plan identifiergoalClass - the goal that this plan can achievemessageTemplate - the template of messages that this plan can process.
public Plan(java.lang.String id,
jade.lang.acl.MessageTemplate messageTemplate)
id - the plan identifiermessageTemplate - the template of messages that this plan can process.| Method Detail |
|---|
public void addGoal(java.lang.Class<? extends Goal> goalClass)
goalClass - the goal class that can be achieved by this plan.public void addMessageTemplate(jade.lang.acl.MessageTemplate messageTemplate)
messageTemplate - the message template of messages that can be processed.public boolean canAchieve(Goal goal)
MessageGoal, it invokes the method
canProcess(ACLMessage). Otherwise, it checks if the class of
this goal is contained in the goal set of this plan.
goal - the goal to be verified.
public boolean canProcess(jade.lang.acl.ACLMessage message)
message - the message to be checked.
public abstract jade.core.behaviours.Behaviour createPlanBody()
throws PlanInstantiationException
Behaviour and also implements the PlanBody interface.
PlanInstantiationException - if an error occurred during the instantiation process.public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.String getId()
public PlanLibrary getPlanLibrary()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()protected void initGoals()
protected void initMessageTemplates()
protected boolean matchesContext(Goal goal)
goal - the goal to be achieved
public void setPlanLibrary(PlanLibrary planLibrary)
planLibrary - the planLibrary to setpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||