Package jason.asSyntax
Class PlanBodyImpl
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.PlanBodyImpl
- All Implemented Interfaces:
LogicalFormula
,PlanBody
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
,Iterable<PlanBody>
Represents a plan body item (achieve, test, action, ...) and its successors.
A plan body like
a1; ?t; !g
is represented by the following structure
(a1, (?t, (!g, ())))
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface jason.asSyntax.PlanBody
PlanBody.BodyType
-
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
ConstructorDescriptionconstructor for empty plan bodyPlanBodyImpl
(PlanBody.BodyType t, boolean planTerm) PlanBodyImpl
(PlanBody.BodyType t, Term b, boolean planTerm) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
clone the plan body and adds it in the end of this planint
clone and applies together (and faster than clone and then apply)clone()
make a deep copy of the termsclonePB()
clone the plan bodyboolean
int
getArity()
returns the number of terms of this literalget as XMLgetHead()
int
getTerm
(int i) returns the i-th term (first term is 0)getTerms()
returns all terms of this literalboolean
isAtom()
boolean
boolean
boolean
iterator()
logicalConsequence
(Agent ag, Unifier un) logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.removeBody
(int index) void
setAsBodyTerm
(boolean b) void
setBodyNext
(PlanBody next) void
setBodyTerm
(Term t) void
void
toString()
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, cloneNS, countVars, delTerm, getSingletonVars, getTermsSize, hasTerm, hasVar, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSource, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, 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 java.lang.Comparable
compareTo
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface jason.asSyntax.Term
cloneNS, countVars, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isNumeric, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
Methods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Constructor Details
-
PlanBodyImpl
public PlanBodyImpl()constructor for empty plan body -
PlanBodyImpl
-
PlanBodyImpl
-
PlanBodyImpl
-
PlanBodyImpl
-
-
Method Details
-
setBodyNext
- Specified by:
setBodyNext
in interfacePlanBody
-
getBodyNext
- Specified by:
getBodyNext
in interfacePlanBody
-
isEmptyBody
public boolean isEmptyBody()- Specified by:
isEmptyBody
in interfacePlanBody
-
getBodyType
- Specified by:
getBodyType
in interfacePlanBody
-
setBodyType
- Specified by:
setBodyType
in interfacePlanBody
-
getBodyTerm
- Specified by:
getBodyTerm
in interfacePlanBody
-
getHead
-
setBodyTerm
- Specified by:
setBodyTerm
in interfacePlanBody
-
isBodyTerm
public boolean isBodyTerm()- Specified by:
isBodyTerm
in interfacePlanBody
-
isAtom
public boolean isAtom() -
setAsBodyTerm
public void setAsBodyTerm(boolean b) - Specified by:
setAsBodyTerm
in interfacePlanBody
-
isPlanBody
public boolean isPlanBody()- Specified by:
isPlanBody
in interfaceTerm
- Overrides:
isPlanBody
in classDefaultTerm
-
iterator
-
getArity
public int getArity()Description copied from class:Literal
returns the number of terms of this literal -
getTerm
Description copied from class:Literal
returns the i-th term (first term is 0) -
getTerms
Description copied from class:Literal
returns all terms of this literal -
setTerm
-
logicalConsequence
Description copied from class:Literal
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequence
in interfaceLogicalFormula
- Overrides:
logicalConsequence
in classLiteral
-
equals
-
calcHashCode
public int calcHashCode()- Overrides:
calcHashCode
in classStructure
-
add
clone the plan body and adds it in the end of this plan -
getLastBody
- Specified by:
getLastBody
in interfacePlanBody
-
add
-
removeBody
- Specified by:
removeBody
in interfacePlanBody
-
getPlanSize
public int getPlanSize()- Specified by:
getPlanSize
in interfacePlanBody
-
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 -
clonePB
Description copied from interface:PlanBody
clone the plan body -
toString
-
getAsDOM
get as XML
-