Package fr.uga.pddl4j.parser
Class ParsedAbstractOperator
java.lang.Object
fr.uga.pddl4j.parser.AbstractParsedObject
fr.uga.pddl4j.parser.ParsedAbstractOperator
- All Implemented Interfaces:
ParsedObject,ParsedOperator,Serializable
- Direct Known Subclasses:
ParsedAction,ParsedMethod
This class defines an abstract planning operator.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface fr.uga.pddl4j.parser.ParsedObject
DEFAULT_BEGIN_LINE, DEFAULT_BEGING_COLUMN, DEFAULT_END_COLUMN, DEFAULT_END_LINE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParsedAbstractOperator(ParsedOperator other)Create a new operator from another.protectedParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions)Creates operator with a specified name, list of parameters, preconditions.protectedParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions, Expression<String> duration)Creates operator with a specified name, list of parameters, preconditions and duration constraints. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn if this operator is equals to another object.intgetArity()Return the arity of the operator, i.e., the number of parameters of the operator.Returns the duration constraints of the operator.getName()Returns the name of the operator.getParameter(Symbol<String> symbol)Returns the parameter of the operator that has a specified symbol.Returns the list of parameters of the operator.Returns the goal description that represents the preconditions of the operator.inthashCode()Returns the hash code value of the operator.booleanReturns if this action is durative operator.voidsetDuration(Expression<String> duration)Sets new duration constraints to the operator.voidSets a new name to the operator.voidsetParameters(List<TypedSymbol<String>> parameters)Sets a new list of parameters to this operator.voidsetPreconditions(Expression<String> preconditions)Sets new preconditions to the operator.toTask()Returns the task representaion of this operator.Methods inherited from class fr.uga.pddl4j.parser.AbstractParsedObject
getBeginColumn, getBeginLine, getEndColumn, getEndLine, setBegin, setBeginColumn, setBeginLine, setEnd, setEndColumn, setEndLineMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.uga.pddl4j.parser.ParsedObject
getBeginColumn, getBeginLine, getEndColumn, getEndLine, setBegin, setBeginColumn, setBeginLine, setEnd, setEndColumn, setEndLine
-
Constructor Details
-
ParsedAbstractOperator
Create a new operator from another.- Parameters:
other- the other operator.
-
ParsedAbstractOperator
protected ParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions)Creates operator with a specified name, list of parameters, preconditions.- Parameters:
name- The name of the operator.parameters- The list of parameters of the operator.preconditions- The goal description that represents the preconditions of the operator.
-
ParsedAbstractOperator
protected ParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions, Expression<String> duration)Creates operator with a specified name, list of parameters, preconditions and duration constraints.- Parameters:
name- The name of the operator.parameters- The list of parameters of the operator.preconditions- The goal description that represents the preconditions of the operator.duration- the duration constraint of the operator.
-
-
Method Details
-
getName
Returns the name of the operator.- Specified by:
getNamein interfaceParsedOperator- Returns:
- the name of the operator.
-
setName
Sets a new name to the operator.- Specified by:
setNamein interfaceParsedOperator- Parameters:
name- the name to set.
-
getParameters
Returns the list of parameters of the operator.- Specified by:
getParametersin interfaceParsedOperator- Returns:
- the list of parameters of the operator.
-
getParameter
Returns the parameter of the operator that has a specified symbol.- Specified by:
getParameterin interfaceParsedOperator- Parameters:
symbol- The symbol.- Returns:
- the parameter of the operator that has a specified symbol or
nullif the operator has no such parameter.
-
toTask
Returns the task representaion of this operator.- Specified by:
toTaskin interfaceParsedOperator- Returns:
- the task representaion of this operator.
-
setParameters
Sets a new list of parameters to this operator.- Specified by:
setParametersin interfaceParsedOperator- Parameters:
parameters- The list of parameters to set.- Throws:
NullPointerException- if the specified parameters is null.
-
getPreconditions
Returns the goal description that represents the preconditions of the operator.- Specified by:
getPreconditionsin interfaceParsedOperator- Returns:
- The goal description that represents the preconditions of the operator.
-
setPreconditions
Sets new preconditions to the operator.- Specified by:
setPreconditionsin interfaceParsedOperator- Parameters:
preconditions- The new goal description that represents the preconditions of the operator to set.- Throws:
NullPointerException- if the specified preconditions is null.
-
getArity
public final int getArity()Return the arity of the operator, i.e., the number of parameters of the operator.- Specified by:
getArityin interfaceParsedOperator- Returns:
- the arity of the operator.
-
getDuration
Returns the duration constraints of the operator.- Specified by:
getDurationin interfaceParsedOperator- Returns:
- the duration constraints of the operator.
-
setDuration
Sets new duration constraints to the operator.- Specified by:
setDurationin interfaceParsedOperator- Parameters:
duration- the duration constraint to set
-
isDurative
public final boolean isDurative()Returns if this action is durative operator.- Specified by:
isDurativein interfaceParsedOperator- Returns:
trueif this operator is a durative,falseotherwise.
-
equals
Return if this operator is equals to another object.- Overrides:
equalsin classObject- Parameters:
object- the other object.- Returns:
trueifobjectis notnull, is an instance of the classAction, and has the same name; otherwise it returnsfalse.- See Also:
Object.equals(java.lang.Object)
-
hashCode
public final int hashCode()Returns the hash code value of the operator.- Overrides:
hashCodein classObject- Returns:
- the hash code value of the operator.
- See Also:
Object.hashCode()
-