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
ModifierConstructorDescriptionprotected
ParsedAbstractOperator(ParsedOperator other)
Create a new operator from another.protected
ParsedAbstractOperator(Symbol<String> name, List<TypedSymbol<String>> parameters, Expression<String> preconditions)
Creates operator with a specified name, list of parameters, preconditions.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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return if this operator is equals to another object.int
getArity()
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.int
hashCode()
Returns the hash code value of the operator.boolean
Returns if this action is durative operator.void
setDuration(Expression<String> duration)
Sets new duration constraints to the operator.void
Sets a new name to the operator.void
setParameters(List<TypedSymbol<String>> parameters)
Sets a new list of parameters to this operator.void
setPreconditions(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, setEndLine
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getName
in interfaceParsedOperator
- Returns:
- the name of the operator.
-
setName
Sets a new name to the operator.- Specified by:
setName
in interfaceParsedOperator
- Parameters:
name
- the name to set.
-
getParameters
Returns the list of parameters of the operator.- Specified by:
getParameters
in interfaceParsedOperator
- Returns:
- the list of parameters of the operator.
-
getParameter
Returns the parameter of the operator that has a specified symbol.- Specified by:
getParameter
in interfaceParsedOperator
- Parameters:
symbol
- The symbol.- Returns:
- the parameter of the operator that has a specified symbol or
null
if the operator has no such parameter.
-
toTask
Returns the task representaion of this operator.- Specified by:
toTask
in interfaceParsedOperator
- Returns:
- the task representaion of this operator.
-
setParameters
Sets a new list of parameters to this operator.- Specified by:
setParameters
in 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:
getPreconditions
in interfaceParsedOperator
- Returns:
- The goal description that represents the preconditions of the operator.
-
setPreconditions
Sets new preconditions to the operator.- Specified by:
setPreconditions
in 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:
getArity
in interfaceParsedOperator
- Returns:
- the arity of the operator.
-
getDuration
Returns the duration constraints of the operator.- Specified by:
getDuration
in interfaceParsedOperator
- Returns:
- the duration constraints of the operator.
-
setDuration
Sets new duration constraints to the operator.- Specified by:
setDuration
in interfaceParsedOperator
- Parameters:
duration
- the duration constraint to set
-
isDurative
public final boolean isDurative()Returns if this action is durative operator.- Specified by:
isDurative
in interfaceParsedOperator
- Returns:
true
if this operator is a durative,false
otherwise.
-
equals
Return if this operator is equals to another object.- Overrides:
equals
in classObject
- Parameters:
object
- the other object.- Returns:
true
ifobject
is 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:
hashCode
in classObject
- Returns:
- the hash code value of the operator.
- See Also:
Object.hashCode()
-