Module org.chocosolver
Class FirstFail
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.selectors.variables.FirstFail
-
- All Implemented Interfaces:
VariableEvaluator<IntVar>
,VariableSelector<IntVar>
public class FirstFail extends Object implements VariableSelector<IntVar>, VariableEvaluator<IntVar>
First fail variable selector. It chooses the leftmost variable with the smallest domain (instantiated variables are ignored).- Since:
- 2 juil. 2010
- Author:
- Charles Prud'homme, Arnaud Malapert
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
evaluate(IntVar variable)
Evaluates the heuristic that is minimized in order to find the best variableIntVar
getVariable(IntVar[] variables)
Provides access to the current selected variable amongvariables
.
-
-
-
Constructor Detail
-
FirstFail
public FirstFail(Model model)
First fail variable selector.- Parameters:
model
- reference to the model (does not define the variable scope)
-
-
Method Detail
-
getVariable
public IntVar getVariable(IntVar[] variables)
Description copied from interface:VariableSelector
Provides access to the current selected variable amongvariables
. If there is no variable left, returnnull
.- Specified by:
getVariable
in interfaceVariableSelector<IntVar>
- Returns:
- the current selected variable if any,
null
otherwise.
-
evaluate
public double evaluate(IntVar variable)
Description copied from interface:VariableEvaluator
Evaluates the heuristic that is minimized in order to find the best variable- Specified by:
evaluate
in interfaceVariableEvaluator<IntVar>
- Parameters:
variable
- array of variable- Returns:
- the result of the evaluation, to minimize
-
-