Interface ComparatorVariable<T extends Var>

Type Parameters:
T - Variable type being compared.
All Known Implementing Classes:
ActivityMax, ActivityMaxDeg, ActivityMin, ActivityMinDeg, AFCMax, AFCMaxDeg, AFCMin, AFCMinDeg, LargestDomain, LargestDomainFloat, LargestMax, LargestMaxFloat, LargestMin, LargestMinFloat, MaxCardDiff, MaxGlbCard, MaxLubCard, MaxRegret, MaxRegretFloat, MinCardDiff, MinDomainOverDegree, MinGlbCard, MinLubCard, MostConstrainedDynamic, MostConstrainedStatic, RandomVar, SmallestDomain, SmallestDomainFloat, SmallestMax, SmallestMaxFloat, SmallestMin, SmallestMinFloat, WeightedDegree, WeightedDegreeFloat

public interface ComparatorVariable<T extends Var>
Defines an interface for comparing variables.
Version:
4.10
  • Method Summary

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

    • compare

      int compare(double metric, T var)
      It compares the baseline metric to the variable metric.
      Parameters:
      metric - 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

      int compare(T leftVar, T rightVar)
      It compares the metric of the left variable against the right one.
      Parameters:
      leftVar - left variable
      rightVar - right variable
      Returns:
      1 if metric for left variable is greater, 0 is they are equal, -1 if smaller.
    • metric

      double metric(T var)
      It returns the metric of the variable given according to the comparator.
      Parameters:
      var - variable for which metric is computed.
      Returns:
      the metric of the variable according to the comparator.