public interface IloIntValueChooser
A value chooser is applied to a variable in a search strategy. It selects a value in the domain of the variable.
An instance of IloIntValueChooser should be used in
conjunction with the class IloSearchPhase
which determines on which variable the value chooser will be applied.
It can be created with a value selector or an array of such selectors
(using IloCP.intValueChooser(IloValueSelector) or
IloCP.intValueChooser(IloValueSelector[])) or by defining
your own chooser of integer values by subclassing the
IloCustomIntValueChooser abstract class.
When created with an array of selectors
(IloValueSelector[]),
the value will be selected in the following way: the first selector in the
array selects a set of values from the selected variable (see
IloSearchPhase).
If more that one value is selected at this stage, the next selector
in the array is applied to the remaining values and so on until
only one value remains or all selectors have been processed.
If, at the end of this process, more than one value remains,
the one chosen will be the smallest one.
For instance, the following code creates a value chooser that selects the value having the largest impact and breaks ties randomly:
IloValueSelector[] valueSel = new IloValueSelector[2];
valueSel[0] = cp.selectLargest(cp.valueImpact());
valueSel[1] = cp.selectRandomValue();
IloIntValueChooser valueChooser = cp.intValueChooser(valueSel);
| Modifier and Type | Method and Description |
|---|---|
void |
end() |