Class Random<T extends Variable>
- java.lang.Object
-
- org.chocosolver.solver.search.strategy.selectors.variables.Random<T>
-
- Type Parameters:
T- type of variable
- All Implemented Interfaces:
VariableEvaluator<T>,VariableSelector<T>
public class Random<T extends Variable> extends Object implements VariableSelector<T>, VariableEvaluator<T>
Random variable selector. It chooses variables randomly, among uninstantiated ones.- Since:
- 2 juil. 2010
- Author:
- Charles Prud'homme
-
-
Constructor Summary
Constructors Constructor Description Random(long seed)Random variable selector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleevaluate(T variable)Evaluates the heuristic that is minimized in order to find the best variableTgetVariable(T[] variables)Provides access to the current selected variable amongvariables.
-
-
-
Method Detail
-
getVariable
public T getVariable(T[] variables)
Description copied from interface:VariableSelectorProvides access to the current selected variable amongvariables. If there is no variable left, returnnull.- Specified by:
getVariablein interfaceVariableSelector<T extends Variable>- Returns:
- the current selected variable if any,
nullotherwise.
-
evaluate
public double evaluate(T variable)
Description copied from interface:VariableEvaluatorEvaluates the heuristic that is minimized in order to find the best variable- Specified by:
evaluatein interfaceVariableEvaluator<T extends Variable>- Parameters:
variable- array of variable- Returns:
- the result of the evaluation, to minimize
-
-