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
ConstructorsConstructorDescriptionAbstractAtomicFormula(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 TypeMethodDescriptionintarity()Returns the arity of this atomic formula, i.e., the number of arguments of the atomic formula.booleanReturn if a specified object is equals to this atomic formula.int[]Returns the arguments of the atomic formula.intReturns the symbol of this atomic formula.inthashCode()Returns the hash code value of the atomic formula.voidsetArguments(int[] arguments)Sets the arguments of the atomic formula.voidsetSymbol(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:
getSymbolin interfaceAtomicFormula- Returns:
- the symbol of this atomic formula.
-
setSymbol
public final void setSymbol(int symbol)Sets the symbole of this atomic formula.- Specified by:
setSymbolin interfaceAtomicFormula- Parameters:
symbol- the symbol of the atomic fomula.
-
getArguments
public final int[] getArguments()Returns the arguments of the atomic formula.- Specified by:
getArgumentsin interfaceAtomicFormula- Returns:
- the arguments of the atomic formula.
-
setArguments
public final void setArguments(int[] arguments)Sets the arguments of the atomic formula.- Specified by:
setArgumentsin 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:
arityin 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 classAbstractAtomicFormulaand it has the same symbol and list of arguments.- Overrides:
equalsin classObject- Parameters:
obj- the specified object to compared.- Returns:
trueif the specified object is equal to the atomic formula;falseotherwise.- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()Returns the hash code value of the atomic formula.- Overrides:
hashCodein classObject- Returns:
- the hash code value of the atomic formula.
- See Also:
Object.hashCode()
-
toString
Returns a string representation of this atomic formula.
-