Package jason.pl
Class PlanLibrary
java.lang.Object
jason.pl.PlanLibrary
- All Implemented Interfaces:
ToDOM
,Serializable
,Iterable<Plan>
Represents a set of plans used by an agent
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a plan into the plan library, either before or after all other plans depending on the boolean parameter.Add a new plan in PL.void
addAll
(PlanLibrary pl) void
void
void
clear()
remove all plansclone()
return a plan for a labelreturn a plan for a labelget as XMLgetAsTxt
(boolean includeKQMLPlans) get as txtgetLock()
getPlans()
add a label to the planboolean
boolean
boolean
boolean
boolean
boolean
boolean
isRoot()
iterator()
remove the plan with label pLabelboolean
Remove a plan represented by the label pLabel.void
void
setFather
(PlanLibrary pl) int
size()
toString()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
KQML_PLANS_FILE
-
TE_JAG_SLEEPING
-
TE_JAG_AWAKING
-
TE_JAG_SHUTTING_DOWN
-
eDOMPlans
-
-
Constructor Details
-
PlanLibrary
public PlanLibrary() -
PlanLibrary
-
-
Method Details
-
isRoot
public boolean isRoot() -
getFather
-
setFather
-
hasPlansForUpdateEvents
public boolean hasPlansForUpdateEvents() -
getLock
-
add
Add a new plan in PL. The source normally is "self" or the agent that sent this plan. If the PL already has a plan equals to the parameter p, only a new source is added.If before is true, the plan will be added in the beginning of the PlanLibrary; otherwise, it is added in the end.
returns the plan just added
- Throws:
JasonException
-
add
- Throws:
JasonException
-
add
Adds a plan into the plan library, either before or after all other plans depending on the boolean parameter.- Parameters:
p
- The plan to be added to the plan librarybefore
- Whether to place the new plan before others- Throws:
JasonException
-
addAll
- Throws:
JasonException
-
addAll
- Throws:
JasonException
-
hasMetaEventPlans
public boolean hasMetaEventPlans() -
hasUserKqmlReceivedPlans
public boolean hasUserKqmlReceivedPlans() -
hasJagPlans
public boolean hasJagPlans() -
getUniqueLabel
add a label to the plan -
get
return a plan for a label -
get
return a plan for a label -
size
public int size() -
getPlans
-
iterator
-
clear
public void clear()remove all plans -
remove
Remove a plan represented by the label pLabel. In case the plan has many sources, only the plan's source is removed. -
remove
remove the plan with label pLabel -
hasCandidatePlan
-
getCandidatePlans
-
clone
-
hasListener
public boolean hasListener() -
addListener
-
removeListener
-
toString
-
getAsTxt
get as txt -
getAsDOM
get as XML
-