Package fr.uga.pddl4j.problem
Class AbstractAtomicFormula
java.lang.Object
fr.uga.pddl4j.problem.AbstractAtomicFormula
- All Implemented Interfaces:
AtomicFormula
,Serializable
- Direct Known Subclasses:
Fluent
,NumericFluent
,Task
This class implements an atomic formula.
- Since:
- 4.0
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorDescriptionAbstractAtomicFormula(int symbol, int[] arguments)
Creates a new atomic formula with a specified symbol and list of arguments.Creates a new atomic formula from an other formula. -
Method Summary
Modifier and TypeMethodDescriptionint
arity()
Returns the arity of this atomic formula, i.e., the number of arguments of the atomic formula.boolean
Return if a specified object is equals to this atomic formula.int[]
Returns the arguments of the atomic formula.int
Returns the symbol of this atomic formula.int
hashCode()
Returns the hash code value of the atomic formula.void
setArguments(int[] arguments)
Sets the arguments of the atomic formula.void
setSymbol(int symbol)
Sets the symbole of this atomic formula.toString()
Returns a string representation of this atomic formula.
-
Constructor Details
-
AbstractAtomicFormula
Creates a new atomic formula from an other formula. This constructor create a deep copy of the formula in parameter.- Parameters:
other
- the other atomic formula.
-
AbstractAtomicFormula
public AbstractAtomicFormula(int symbol, int[] arguments)Creates a new atomic formula with a specified symbol and list of arguments.- Parameters:
symbol
- the symbol of the atomic formula.arguments
- the list of arguments of the atomic formula.
-
-
Method Details
-
getSymbol
public final int getSymbol()Returns the symbol of this atomic formula.- Specified by:
getSymbol
in interfaceAtomicFormula
- Returns:
- the symbol of this atomic formula.
-
setSymbol
public final void setSymbol(int symbol)Sets the symbole of this atomic formula.- Specified by:
setSymbol
in interfaceAtomicFormula
- Parameters:
symbol
- the symbol of the atomic fomula.
-
getArguments
public final int[] getArguments()Returns the arguments of the atomic formula.- Specified by:
getArguments
in interfaceAtomicFormula
- Returns:
- the arguments of the atomic formula.
-
setArguments
public final void setArguments(int[] arguments)Sets the arguments of the atomic formula.- Specified by:
setArguments
in interfaceAtomicFormula
- Parameters:
arguments
- the arguments of the atomic formula.
-
arity
public final int arity()Returns the arity of this atomic formula, i.e., the number of arguments of the atomic formula.- Specified by:
arity
in interfaceAtomicFormula
- Returns:
- the arity of this atomic formula.
-
equals
Return if a specified object is equals to this atomic formula. The specified object is equal to the atomic formula if and only if the object is an instance of the classAbstractAtomicFormula
and it has the same symbol and list of arguments.- Overrides:
equals
in classObject
- Parameters:
obj
- the specified object to compared.- Returns:
true
if the specified object is equal to the atomic formula;false
otherwise.- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()Returns the hash code value of the atomic formula.- Overrides:
hashCode
in classObject
- Returns:
- the hash code value of the atomic formula.
- See Also:
Object.hashCode()
-
toString
Returns a string representation of this atomic formula.
-