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, emptyTermListFields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCacheFields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadds the annotation source(agName)voidaddSubPlan(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 IMvoiddelLabel()booleandeletes one source(agName) annotation, return true if deletedvoiddeletes all source annotationsbooleanintgetArity()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 getTriggerbooleanbooleanbooleanbooleanreturns true if this literal has some source annotationbooleanreturns true if this literal has a "source(agName)"booleanbooleanbooleanisAtomic()booleanisRelevant(Trigger te, Unifier u) returns an unifier if this plan is relevant for the event te, returns null otherwise.static Plancreates a plan from a list with four elements: [L, T, C, B]static Planprefer using ASSyntax.parsePlanvoidsetAsPlanTerm(boolean b) voidvoidvoidvoidsetScope(PlanLibrary pl) voidvoidreturns 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, varToReplaceMethods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods 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, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Plan
public Plan() -
Plan
-
-
Method Details
-
getArity
public int getArity()Description copied from class:Literalreturns the number of terms of this literal -
setSourceFile
-
getSourceFile
-
getFile
Deprecated. -
getTerm
Description copied from class:Literalreturns 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:Literalreturns this literal as a list with three elements: [namespace, functor, list of terms, list of annots]- Overrides:
getAsListOfTermsin 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:Termclone and applies together (and faster than clone and then apply) -
clone
Description copied from class:Structuremake a deep copy of the terms -
cloneNS
Description copied from interface:Termclone 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:Literalreturns true if this literal has some source annotation -
hasSource
Description copied from class:Literalreturns true if this literal has a "source(agName)" -
getSources
Description copied from class:Literalreturns the sources of this literal as a new list. e.g.: from annots [source(a), source(b)], it returns [a,b]- Overrides:
getSourcesin classLiteral
-
addSource
Description copied from class:Literaladds the annotation source(agName) -
delSource
Description copied from class:Literaldeletes one source(agName) annotation, return true if deleted -
delSources
public void delSources()Description copied from class:Literaldeletes all source annotations- Overrides:
delSourcesin classLiteral
-