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