Class Effect

All Implemented Interfaces:
FluentDescription, Serializable

public class Effect extends AbstractFluentDescription
This class implements the effect of the actions.
Since:
4.0
See Also:
FluentDescription, NumericAssignment, Serialized Form
  • Constructor Details

    • Effect

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

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

      public Effect(BitVector positive, BitVector negative)
      Creates new effect from a specified positive and negative timed fluent description and an empty set of numeric assignments.
      Parameters:
      positive - the positive bit vetcor of this effect.
      negative - the negative bit vetcor of the effect.
  • Method Details

    • getNumericAssignments

      public final Set<NumericAssignment> getNumericAssignments()
      Returns the numeric assignments of the effect.
      Returns:
      the numeric assignments of the effect.
    • setNumericAssignments

      public final void setNumericAssignments(Set<NumericAssignment> assignments)
      Sets the numeric assignments of the effect.
      Parameters:
      assignments - the numeric assignments of the effect.
    • addNumericAssignment

      public final void addNumericAssignment(NumericAssignment assignment)
      Adds a numeric assignment to the effect.
      Parameters:
      assignment - the numeric assignment to add.
    • hashCode

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

      public boolean equals(Object object)
      Return if a specified object is equals to this effect. The specified object is equal to the effect if and only if the object is an instance of the class Effect and it has the same positive and negative timed fluent description and the same numeric assignments.
      Overrides:
      equals in class Object
      Parameters:
      object - 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 this effect.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this effect.