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 double
evaluate(V variable)
Evaluates the heuristic that is minimized in order to find the best variableV
getVariable(V[] variables)
Provides access to the current selected variable amongvariables
.
-
-
-
Method Detail
-
getVariable
public V getVariable(V[] 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<V extends Variable>
- Returns:
- the current selected variable if any,
null
otherwise.
-
evaluate
public double evaluate(V variable)
Description copied from interface:VariableEvaluator
Evaluates the heuristic that is minimized in order to find the best variable- Specified by:
evaluate
in interfaceVariableEvaluator<V extends Variable>
- Parameters:
variable
- array of variable- Returns:
- the result of the evaluation, to minimize
-
-