Class Condition

All Implemented Interfaces:
FluentDescription, Serializable
Direct Known Subclasses:
Goal

public class Condition extends AbstractFluentDescription
This class implements the precondition of the actions or the methods.
Since:
4.0
See Also:
FluentDescription, NumericConstraint, Serialized Form
  • Constructor Details

    • Condition

      public Condition()
      Creates new effect. By default the effect has no positive and no negative fluents.
    • Condition

      public Condition(Condition other)
      Creates new effect from an other one. This constructor create a deep copy of the object in parameter.
      Parameters:
      other - the other one.
    • Condition

      public Condition(BitVector positive, BitVector negative)
      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

      public final List<NumericConstraint> getNumericConstraints()
      Returns the numeric constraints of the precondition.
      Returns:
      the numeric constraints of the precondition.
    • setNumericConstraints

      public final void setNumericConstraints(List<NumericConstraint> constraints)
      Sets the numeric constraints of the precondition.
      Parameters:
      constraints - the numeric constraints of the precondition.
    • addNumericConstraint

      public final void addNumericConstraint(NumericConstraint constraint)
      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 class Object
      Returns:
      the hash code value of the precondition.
      See Also:
      Object.hashCode()
    • equals

      public boolean equals(Object obj)
      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 class Condition and it has the same positive and negative timed fluent description.
      Overrides:
      equals in class Object
      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

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