Class TemporalCondition

java.lang.Object
fr.uga.pddl4j.problem.time.TemporalCondition
All Implemented Interfaces:
Serializable

public class TemporalCondition extends Object implements Serializable
This class implements the time condition used to describe precondition of actions and methods.
Since:
4.0
See Also:
Condition, Serialized Form
  • Constructor Details

    • TemporalCondition

      public TemporalCondition(TemporalCondition other)
      Creates a new time condition from another one.
      Parameters:
      other - the time condition.
    • TemporalCondition

      public TemporalCondition()
      Creates new empty time condition.
    • TemporalCondition

      public TemporalCondition(Condition atStart, Condition overall, Condition atEnd)
      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

      public Condition getAtStartCondition()
      Returns the at start condition of the time condition.
      Returns:
      the at start condition of the time condition.
    • getAtEndCondition

      public Condition getAtEndCondition()
      Returns the at end condition of the time condition.
      Returns:
      the at end condition of the time condition.
    • getOverallCondition

      public Condition getOverallCondition()
      Returns the overall condition of the time condition.
      Returns:
      the overall condition of the time condition.
    • setAtStartCondition

      public void setAtStartCondition(Condition atStart)
      Sets the at start condition of the time condition.
      Parameters:
      atStart - the at start condition to set.
    • setAtEndCondition

      public void setAtEndCondition(Condition atEnd)
      Sets the at end condition of the time condition.
      Parameters:
      atEnd - the at end condition to set.
    • setOverallCondition

      public void setOverallCondition(Condition overall)
      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 consistent false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code value of the time condition.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value of the time condition.
      See Also:
      Object.hashCode()
    • equals

      public boolean equals(Object obj)
      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 class TemporalCondition and it has the same at start, at end and overall condition.
      Overrides:
      equals in class Object
      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

      public String toString()
      Returns a string representation of the precondition.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the precondition.