Package jason.asSyntax
Class Plan
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.Plan
- All Implemented Interfaces:
LogicalFormula
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
Represents an AgentSpeak plan
(it extends structure to be used as a term)
- See Also:
-
Field Summary
Fields inherited from class jason.asSyntax.Structure
emptyTermArray, emptyTermList
Fields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadds the annotation source(agName)void
addSubPlan
(Plan p) clone and applies together (and faster than clone and then apply)clone()
make a deep copy of the termsclone in another namespaceused to create a plan clone in a new IMvoid
delLabel()
boolean
deletes one source(agName) annotation, return true if deletedvoid
deletes all source annotationsboolean
int
getArity()
returns the number of terms of this literalget as XMLreturns this literal as a list with three elements: [namespace, functor, list of terms, list of annots]getBody()
getFile()
Deprecated.getLabel()
getScope()
returns the sources of this literal as a new list.getTerm
(int i) returns the i-th term (first term is 0)Deprecated.use getTriggerboolean
boolean
boolean
boolean
returns true if this literal has some source annotationboolean
returns true if this literal has a "source(agName)"boolean
boolean
boolean
isAtomic()
boolean
isRelevant
(Trigger te, Unifier u) returns an unifier if this plan is relevant for the event te, returns null otherwise.static Plan
creates a plan from a list with four elements: [L, T, C, B]static Plan
prefer using ASSyntax.parsePlanvoid
setAsPlanTerm
(boolean b) void
void
void
void
setScope
(PlanLibrary pl) void
void
returns this plan in a string complaint with AS syntaxtoString()
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, countVars, delTerm, getSingletonVars, getTerms, getTermsSize, hasTerm, hasVar, isAtom, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getPredicateIndicator, getTermsArray, hasAnnot, hasAnnot, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, logicalConsequence, negated, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Plan
public Plan() -
Plan
-
-
Method Details
-
getArity
public int getArity()Description copied from class:Literal
returns the number of terms of this literal -
setSourceFile
-
getSourceFile
-
getFile
Deprecated. -
getTerm
Description copied from class:Literal
returns the i-th term (first term is 0) -
setTerm
-
setLabel
-
getLabel
-
delLabel
public void delLabel() -
setContext
-
setAsPlanTerm
public void setAsPlanTerm(boolean b) -
isPlanTerm
public boolean isPlanTerm() -
getAsListOfTerms
Description copied from class:Literal
returns this literal as a list with three elements: [namespace, functor, list of terms, list of annots]- Overrides:
getAsListOfTerms
in classLiteral
-
newFromListOfTerms
creates a plan from a list with four elements: [L, T, C, B]- Throws:
JasonException
-
parse
prefer using ASSyntax.parsePlan -
getTriggerEvent
Deprecated.use getTrigger -
getTrigger
-
getContext
-
getBody
-
isAtomic
public boolean isAtomic() -
hasBreakpoint
public boolean hasBreakpoint() -
isAllUnifs
public boolean isAllUnifs() -
isRelevant
returns an unifier if this plan is relevant for the event te, returns null otherwise. -
equals
-
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply) -
clone
Description copied from class:Structure
make a deep copy of the terms -
cloneNS
Description copied from interface:Term
clone in another namespace -
cloneOnlyBody
used to create a plan clone in a new IM -
toString
-
toASString
returns this plan in a string complaint with AS syntax -
getAsDOM
get as XML -
addSubPlan
- Throws:
JasonException
-
hasSubPlans
public boolean hasSubPlans() -
hasInterestInUpdateEvents
public boolean hasInterestInUpdateEvents() -
getSubPlans
-
setScope
-
getScope
-
setGoalCondition
-
getGoalCondition
-
hasGoalCondition
public boolean hasGoalCondition() -
hasSource
public boolean hasSource()Description copied from class:Literal
returns true if this literal has some source annotation -
hasSource
Description copied from class:Literal
returns true if this literal has a "source(agName)" -
getSources
Description copied from class:Literal
returns the sources of this literal as a new list. e.g.: from annots [source(a), source(b)], it returns [a,b]- Overrides:
getSources
in classLiteral
-
addSource
Description copied from class:Literal
adds the annotation source(agName) -
delSource
Description copied from class:Literal
deletes one source(agName) annotation, return true if deleted -
delSources
public void delSources()Description copied from class:Literal
deletes all source annotations- Overrides:
delSources
in classLiteral
-