public class Op
extends java.lang.Object
implements java.io.Serializable
Modifications:
Constructor and Description |
---|
Op(Op other)
Create a new operator from another.
|
Op(Symbol name,
java.util.List<TypedSymbol> parameters,
Exp preconds,
Exp effects)
Creates operator with a specified name, list of parameters, preconditions and effects.
|
Op(Symbol name,
java.util.List<TypedSymbol> parameters,
Exp preconditions,
Exp effects,
Exp duration)
Creates operator with a specified name, list of parameters, preconditions and effects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
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.
|
Exp |
getDuration()
Returns the goal description that represents the duration constraints of the operator.
|
Exp |
getEffects()
Returns the goal description that represents the effects of the operator.
|
Symbol |
getName()
Returns the name of the operator.
|
TypedSymbol |
getParameter(Symbol symbol)
Returns the parameter of the operator that has a specified symbol.
|
java.util.List<TypedSymbol> |
getParameters()
Returns the list of parameters of the operator.
|
Exp |
getPreconditions()
Returns the goal description that represents the preconditions of the operator.
|
int |
hashCode()
Returns the hash code value of the operator.
|
void |
normalize()
Normalizes the operators.
|
void |
normalize(int index)
Normalizes the operators.
|
void |
setDuration(Exp duration)
Sets new duration constraints to the operator.
|
void |
setEffects(Exp effects)
Sets new effects to the operator.
|
void |
setName(Symbol name)
Sets a new name to the operator.
|
void |
setParameters(java.util.List<TypedSymbol> parameters)
Sets a new list of parameters to this operator.
|
void |
setPreconditions(Exp preconditions)
Sets new preconditions to the operator.
|
java.lang.String |
toString()
Returns a PDDL string representation of the operator.
|
public Op(Op other)
other
- the other operator.public Op(Symbol name, java.util.List<TypedSymbol> parameters, Exp preconds, Exp effects)
name
- The name of the operator.parameters
- The list of parameters of the operator.preconds
- The goal description that represents the preconditions of the operator.effects
- The goal description that represents the effects of the operator.public Op(Symbol name, java.util.List<TypedSymbol> parameters, Exp preconditions, Exp effects, Exp duration)
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.effects
- The goal description that represents the effects of the operator.duration
- The goal description that represents the duration constraints of the
operator.java.lang.NullPointerException
- if the specified name, parameters, preconditions or effects are
null.public final Symbol getName()
public final void setName(Symbol name)
name
- the name to set.public final java.util.List<TypedSymbol> getParameters()
public final TypedSymbol getParameter(Symbol symbol)
symbol
- The symbol.null
if the
operator has no such parameter.public final void setParameters(java.util.List<TypedSymbol> parameters)
parameters
- The list of parameters to set.java.lang.NullPointerException
- if the specified parameters is null.public final Exp getPreconditions()
public final void setPreconditions(Exp preconditions)
preconditions
- The new goal description that represents the preconditions of the
operator to set.java.lang.NullPointerException
- if the specified preconditions is null.public final Exp getEffects()
public final void setEffects(Exp effects)
effects
- he new goal description that represents the effects of the operator to set.java.lang.NullPointerException
- if the specified effects is null.public final Exp getDuration()
public final void setDuration(Exp duration)
duration
- the duration constraint to setpublic void normalize() throws FatalException
FatalException
Exp.renameVariables()
,
Exp.moveNegationInward()
public void normalize(int index) throws FatalException
index
- the index of the first variable, index.e., ?Xi.FatalException
Exp.renameVariables()
,
Exp.moveNegationInward()
public final int getArity()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the other object.true
if object
is not null
, is an instance of
the class Op
, and has the same name; otherwise it returns false
.Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object