Package fr.uga.pddl4j.problem.time
Class TemporalCondition
java.lang.Object
fr.uga.pddl4j.problem.time.TemporalCondition
- All Implemented Interfaces:
Serializable
This class implements the time condition used to describe precondition of actions and methods.
- Since:
- 4.0
- See Also:
Condition, Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreates new empty time condition.TemporalCondition(Condition atStart, Condition overall, Condition atEnd)Creates a new time condition from a specified 'at start", 'overall' and 'at end condition.TemporalCondition(TemporalCondition other)Creates a new time condition from another one. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the cardinality of the condition, i.e., the number of fluents defined in the at start, at end and overall conditions.booleanReturn if a specified object is equals to this time condition.Returns the at end condition of the time condition.Returns the at start condition of the time condition.Returns the overall condition of the time condition.inthashCode()Returns the hash code value of the time condition.booleanReturns if this time condition is consistent.booleanisEmpty()Returns if condition is empty, i.e., if the condition has no positive and no negative for at start, at end and overall.voidsetAtEndCondition(Condition atEnd)Sets the at end condition of the time condition.voidsetAtStartCondition(Condition atStart)Sets the at start condition of the time condition.voidsetOverallCondition(Condition overall)Sets the overall condition of the time condition.toString()Returns a string representation of the precondition.
-
Constructor Details
-
TemporalCondition
Creates a new time condition from another one.- Parameters:
other- the time condition.
-
TemporalCondition
public TemporalCondition()Creates new empty time condition. -
TemporalCondition
Creates a new time condition from a specified 'at start", 'overall' and 'at end condition.- Parameters:
atStart- the start condition.overall- the overall condition.atEnd- the atEnd condition.
-
-
Method Details
-
getAtStartCondition
Returns the at start condition of the time condition.- Returns:
- the at start condition of the time condition.
-
getAtEndCondition
Returns the at end condition of the time condition.- Returns:
- the at end condition of the time condition.
-
getOverallCondition
Returns the overall condition of the time condition.- Returns:
- the overall condition of the time condition.
-
setAtStartCondition
Sets the at start condition of the time condition.- Parameters:
atStart- the at start condition to set.
-
setAtEndCondition
Sets the at end condition of the time condition.- Parameters:
atEnd- the at end condition to set.
-
setOverallCondition
Sets the overall condition of the time condition.- Parameters:
overall- the at end condition to set.
-
isEmpty
public final boolean isEmpty()Returns if condition is empty, i.e., if the condition has no positive and no negative for at start, at end and overall. Such a condition is always true.- Returns:
trueif the condition is empty;falseotherwise.
-
cardinality
public final int cardinality()Returns the cardinality of the condition, i.e., the number of fluents defined in the at start, at end and overall conditions.- Returns:
- the cardinality of the time condition.
-
isConsistent
public final boolean isConsistent()Returns if this time condition is consistent. A time condition is consistent if at start, at end and overall condition are consistent.- Returns:
trueif this time condition is consistentfalseotherwise.
-
hashCode
public int hashCode()Returns the hash code value of the time condition.- Overrides:
hashCodein classObject- Returns:
- the hash code value of the time condition.
- See Also:
Object.hashCode()
-
equals
Return if a specified object is equals to this time condition. The specified object is equal to the time conditiion if and only if the object is an instance of the classTemporalConditionand it has the same at start, at end and overall condition.- Overrides:
equalsin classObject- Parameters:
obj- the specified object to compared.- Returns:
trueif the specified object is equal to this time condition;falseotherwise.- See Also:
Object.equals(java.lang.Object)
-
toString
Returns a string representation of the precondition.
-