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
ConstructorDescriptionCreates 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 TypeMethodDescriptionint
Returns the cardinality of the condition, i.e., the number of fluents defined in the at start, at end and overall conditions.boolean
Return 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.int
hashCode()
Returns the hash code value of the time condition.boolean
Returns if this time condition is consistent.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.void
setAtEndCondition(Condition atEnd)
Sets the at end condition of the time condition.void
setAtStartCondition(Condition atStart)
Sets the at start condition of the time condition.void
setOverallCondition(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:
true
if the condition is empty;false
otherwise.
-
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:
true
if this time condition is consistentfalse
otherwise.
-
hashCode
public int hashCode()Returns the hash code value of the time condition.- Overrides:
hashCode
in 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 classTemporalCondition
and it has the same at start, at end and overall condition.- Overrides:
equals
in classObject
- Parameters:
obj
- the specified object to compared.- Returns:
true
if the specified object is equal to this time condition;false
otherwise.- See Also:
Object.equals(java.lang.Object)
-
toString
Returns a string representation of the precondition.
-