Interface VariableEvaluator<V extends Variable>

  • All Known Implementing Classes:
    AntiFirstFail, FirstFail, Largest, MaxDelta, MaxRegret, MinDelta, Occurrence, Random, RandomVar, Smallest

    public interface VariableEvaluator<V extends Variable>
    A variable evaluator. One provide a way to evaluate a variable (domain size, smallest values, ...). It should return a value which can be minimized. For instance, to select the integer variable with the smallest value in its domain, return ivar.getLB(). To select the variable with the largest value in its domain, return -ivar.getUB().

    Such evaluator can be called and combined with others to define a variable selector which enables tie breaking. Indeed, many uninstantied variables may return the same value for the evaluation. In that case, the next evaluator should break ties, otherwise the first computed variable would be returned.

    Be aware that using a single variable evaluator in solver.search.strategy.selectors.VariableSelectorWithTies may result in a slower execution due to the generalisation it requires.

    Since:
    17/03/2014
    Author:
    Charles Prud'homme
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double evaluate​(V variable)
      Evaluates the heuristic that is minimized in order to find the best variable
    • Method Detail

      • evaluate

        double evaluate​(V variable)
        Evaluates the heuristic that is minimized in order to find the best variable
        Parameters:
        variable - array of variable
        Returns:
        the result of the evaluation, to minimize