Class GreaterThanOrEqual

All Implemented Interfaces:
Serializable, Comparable<Constraint>, Constraint, Copyable<Constraint>, Defined, Named

public class GreaterThanOrEqual extends ThresholdConstraint
The greater than or equal to constraint, or <value> >= <threshold>.
See Also:
  • Constructor Details

    • GreaterThanOrEqual

      public GreaterThanOrEqual(double threshold)
      Constructs a new greater than or equal to constraint.
      Parameters:
      threshold - the threshold value
    • GreaterThanOrEqual

      public GreaterThanOrEqual(double threshold, double epsilon)
      Constructs a new greater than or equal to constraint.
      Parameters:
      threshold - the threshold value
      epsilon - the epsilon value
    • GreaterThanOrEqual

      public GreaterThanOrEqual(String name, double threshold)
      Constructs a new greater than or equal to constraint.
      Parameters:
      name - the name
      threshold - the threshold value
    • GreaterThanOrEqual

      public GreaterThanOrEqual(String name, double threshold, double epsilon)
      Constructs a new greater than or equal to constraint.
      Parameters:
      name - the name
      threshold - the threshold value
      epsilon - the epsilon value
    • GreaterThanOrEqual

      public GreaterThanOrEqual(GreaterThanOrEqual copy)
      Constructs a copy of a greater than or equal to constraint.
      Parameters:
      copy - the constraint to copy
  • Method Details

    • getMagnitudeOfViolation

      public double getMagnitudeOfViolation()
      Description copied from interface: Constraint
      Returns the magnitude of constraint violation as a non-negative number, with 0.0 representing satisfied or feasible constraints. When comparing two constraints, smaller magnitudes are considered better.
      Returns:
      the magnitude of constraint violation
    • copy

      public GreaterThanOrEqual copy()
      Description copied from interface: Copyable
      Creates and returns a copy of this object. It is required that x.copy() is completely independent from x. This means any method invoked on x.copy() in no way alters the state of x and vice versa. It is typically the case that x.copy().getClass() == x.getClass() and x.copy().equals(x).
      Returns:
      the copy
    • to

      public static GreaterThanOrEqual to(double threshold)
      Constructs a new greater than or equal to constraint.
      Parameters:
      threshold - the threshold value
      Returns:
      the constraint
    • to

      public static GreaterThanOrEqual to(double threshold, double epsilon)
      Constructs a new greater than or equal to constraint.
      Parameters:
      threshold - the threshold value
      epsilon - the epsilon value
      Returns:
      the constraint
    • to

      public static GreaterThanOrEqual to(String name, double threshold)
      Constructs a new greater than or equal to constraint.
      Parameters:
      name - the name
      threshold - the threshold value
      Returns:
      the constraint
    • to

      public static GreaterThanOrEqual to(String name, double threshold, double epsilon)
      Constructs a new greater than or equal to constraint.
      Parameters:
      name - the name
      threshold - the threshold value
      epsilon - the epsilon value
      Returns:
      the constraint