Package fr.uga.pddl4j.problem.operator
Class Condition
java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractFluentDescription
fr.uga.pddl4j.problem.operator.Condition
- All Implemented Interfaces:
FluentDescription
,Serializable
- Direct Known Subclasses:
Goal
This class implements the precondition of the actions or the methods.
- Since:
- 4.0
- See Also:
FluentDescription
,NumericConstraint
, Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNumericConstraint(NumericConstraint constraint)
Adds a numeric constraints of the precondition.boolean
Return if a specified object is equals to this precondition.Returns the numeric constraints of the precondition.int
hashCode()
Returns the hash code value of the precondition.void
setNumericConstraints(List<NumericConstraint> constraints)
Sets the numeric constraints of the precondition.toString()
Returns a string representation of the precondition.Methods inherited from class fr.uga.pddl4j.problem.operator.AbstractFluentDescription
cardinality, getNegativeFluents, getPositiveFluents, isConsistent, isEmpty
-
Constructor Details
-
Condition
public Condition()Creates new effect. By default the effect has no positive and no negative fluents. -
Condition
Creates new effect from an other one. This constructor create a deep copy of the object in parameter.- Parameters:
other
- the other one.
-
Condition
Creates new effect from a specified positive and negative fluent description and an empty set of numeric constraints.- Parameters:
positive
- the positive bit vector of fluent description.negative
- the negative bit vector of fluent description.
-
-
Method Details
-
getNumericConstraints
Returns the numeric constraints of the precondition.- Returns:
- the numeric constraints of the precondition.
-
setNumericConstraints
Sets the numeric constraints of the precondition.- Parameters:
constraints
- the numeric constraints of the precondition.
-
addNumericConstraint
Adds a numeric constraints of the precondition.- Parameters:
constraint
- the numeric constraint to add.
-
hashCode
public int hashCode()Returns the hash code value of the precondition.- Overrides:
hashCode
in classObject
- Returns:
- the hash code value of the precondition.
- See Also:
Object.hashCode()
-
equals
Return if a specified object is equals to this precondition. The specified object is equal to the precondition if and only if the object is an instance of the classCondition
and it has the same positive and negative timed fluent description.- Overrides:
equals
in classObject
- Parameters:
obj
- the specified object to compared.- Returns:
true
if the specified object is equal to the precondition;false
otherwise.- See Also:
Object.equals(java.lang.Object)
-
toString
Returns a string representation of the precondition.
-