Class MaxRegretFloat<T extends FloatVar>

java.lang.Object
org.jacop.floats.search.MaxRegretFloat<T>
Type Parameters:
T - variable of type FloatVar.
All Implemented Interfaces:
ComparatorVariable<T>

public class MaxRegretFloat<T extends FloatVar> extends Object implements ComparatorVariable<T>
Defines a MaxRegretFloat comparator for Variables.
Version:
4.10
  • Constructor Summary

    Constructors
    Constructor
    Description
    It constructs MaxRegretFloat comparator.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compare(double ldiff, T var)
    It compares the baseline metric to the variable metric.
    int
    compare(T left, T right)
    It compares the metric of the left variable against the right one.
    double
    metric(T o)
    It returns the metric of the variable given according to the comparator.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MaxRegretFloat

      public MaxRegretFloat()
      It constructs MaxRegretFloat comparator.
  • Method Details

    • compare

      public int compare(double ldiff, T var)
      Description copied from interface: ComparatorVariable
      It compares the baseline metric to the variable metric.
      Specified by:
      compare in interface ComparatorVariable<T extends FloatVar>
      Parameters:
      ldiff - the baseline for comparison.
      var - variable which is compared to baseline.
      Returns:
      1 if metric is larger than variable, 0 if equal, -1 if baseline is smaller.
    • compare

      public int compare(T left, T right)
      Description copied from interface: ComparatorVariable
      It compares the metric of the left variable against the right one.
      Specified by:
      compare in interface ComparatorVariable<T extends FloatVar>
      Parameters:
      left - left variable
      right - right variable
      Returns:
      1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
    • metric

      public double metric(T o)
      Description copied from interface: ComparatorVariable
      It returns the metric of the variable given according to the comparator.
      Specified by:
      metric in interface ComparatorVariable<T extends FloatVar>
      Parameters:
      o - variable for which metric is computed.
      Returns:
      the metric of the variable according to the comparator.