Class Occurrence<V extends Variable>
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.selectors.variables.Occurrence<V>
-
- All Implemented Interfaces:
VariableEvaluator<V>,VariableSelector<V>
public class Occurrence<V extends Variable> extends Object implements VariableSelector<V>, VariableEvaluator<V>
Occurrence variable selector. It chooses the variable with the largest number of attached propagators (instantiated variables are ignored).
TODO: could be based on the number of not entailed propagators- Since:
- 2 juil. 2010
- Author:
- Charles Prud'homme
-
-
Constructor Summary
Constructors Constructor Description Occurrence()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleevaluate(V variable)Evaluates the heuristic that is minimized in order to find the best variableVgetVariable(V[] variables)Provides access to the current selected variable amongvariables.
-
-
-
Method Detail
-
getVariable
public V getVariable(V[] variables)
Description copied from interface:VariableSelectorProvides access to the current selected variable amongvariables. If there is no variable left, returnnull.- Specified by:
getVariablein interfaceVariableSelector<V extends Variable>- Returns:
- the current selected variable if any,
nullotherwise.
-
evaluate
public double evaluate(V variable)
Description copied from interface:VariableEvaluatorEvaluates the heuristic that is minimized in order to find the best variable- Specified by:
evaluatein interfaceVariableEvaluator<V extends Variable>- Parameters:
variable- array of variable- Returns:
- the result of the evaluation, to minimize
-
-