Overview | Group | Tree | Graph | Index | Concepts |
This class is a goal for instantiating an array of integer variables. It
implements a family of strategies based on filters. It selects an
uninstantiated variable x
and a value v
in the
domain of x
and creates the choice point
IlcOr(IlcSetValue(x, v), IlcRemoveValue(x, v))
. If the value
returned by
IloCustomizableGoal::getBestGenerate
is
IloTrue
, it then selects another variable, otherwise it selects
another value for the variable x
. The goal succeeds when all
variables of the array are instantiated.
To select variables and values, the goal uses an ordered list of filters for variables and an ordered list of filters for values.
In its simplest form, a filter for variables is defined by an evaluator
taking an IlcIntVar
as argument. A filter keeps the variables
with the smallest evaluation and discards the others. The filters are
applied in the order of addition to the IloCustomizableGoal
instance. The first filter keeps the best variables. If several variables
remain, the next filter is applied. If no more filters remain, the variable
with the smallest index in the array given in the constructor is selected.
A value for the selected variable is selected by values filters. In its
simplest form, a filter for values is defined by an evaluator taking an
IlcInt
(the value) as argument and an IloIntVar
as a context (the selected variable is passed as a context). Filters for
values operate in the same way as filters for variables. When several
values remain after having applied all the filters, the smallest value is
selected.
By default an instance of IloCustomizableGoal
contains two
filters for variables: the first one selects the variables with the largest
impact and the second one selects randomly. It contains two selectors for
values: the first one selects the value with the smallest impact and the
second one selects randomly. When adding a filter for variables (or,
respectively, values), the default filters for variables (or, respectively,
values) are discarded.
More complex filters can be added to keep more variables than just the ones
with the smallest evaluation. For an example of how to use
IloCustomizableGoal
, see "Using Impacts during Search"
in the IBM ILOG Solver User's Manual.
See Also:
IlcImpactValueEvaluator, IlcSuccessRateValueEvaluator, IlcRandomValueEvaluator, IlcImpactVarEvaluator, IlcSuccessRateVarEvaluator, IlcLocalImpactVarEvaluator, IlcRandomVarEvaluator, IlcSizeVarEvaluator, IlcDegreeVarEvaluator, IlcSizeOverDegreeVarEvaluator, IlcReductionVarEvaluator, IlcBranchImpactVarEvaluator
Constructor Summary | |
---|---|
public | IloCustomizableGoal(IloEnv env, IloIntVarArray x) |
Method Summary | |
---|---|
public void | addAbsoluteToleranceFilter(IloEvaluator< IlcInt > e, IlcFloat tol) |
public void | addAbsoluteToleranceFilter(IloEvaluator< IlcIntVar > e, IlcFloat tol) |
public void | addFilter(IloEvaluator< IlcInt > e) |
public void | addFilter(IloEvaluator< IlcIntVar > e) |
public void | addMinNumberFilter(IloEvaluator< IlcInt > e, IlcFloat number) |
public void | addMinNumberFilter(IloEvaluator< IlcIntVar > e, IlcFloat number) |
public void | addMinProportionFilter(IloEvaluator< IlcInt > e, IlcFloat proportion) |
public void | addMinProportionFilter(IloEvaluator< IlcIntVar > e, IlcFloat proportion) |
public void | addRelativeToleranceFilter(IloEvaluator< IlcInt > e, IlcFloat tol) |
public void | addRelativeToleranceFilter(IloEvaluator< IlcIntVar > e, IlcFloat tol) |
public IlcBool | getBestGenerate() |
public void | setBestGenerate(IloBool best) |
Inherited Methods from IloGoal |
---|
end, getEnv, getImpl, getName, getObject, setName, setObject |
Constructor Detail |
---|
This constructor creates a customizable goal on the environment
env
. The parameter x
is the array of
variables to perform search on.
Method Detail |
---|
This member function adds a filter for values that keeps the
values that are at a distance of at most tol
from the best evaluation.
This member function adds a filter for variables that keeps the
variables that are at a distance of at most tol
from
the best evaluation.
This member function adds a basic filter for values that keeps all the values with the smallest evaluation.
This member function adds a basic filter for variables that keeps all the variables with the smallest evaluation.
This member function adds a filter for values that keeps at least
number
of the values with the smallest evaluation.
This member function adds a filter for variables that keeps at least
number
of the variables with the smallest evaluation.
This member function adds a filter for values that keeps at least a
proportion p
of the values with the smallest evaluation.
The value p
must be greater than 0 and less than or
equal to 1.
This member function adds a filter for variables that keeps at least
a proportion p
of the variables with the smallest evaluation.
The value p
must be greater than 0 and less than or
equal to 1.
This member function adds a filter for values that keeps the
values that are at a relative distance of at most tol
from the best evaluation.
This member function adds a filter for variables that keeps the
variables that are at a relative distance of at most tol
from the best evaluation.
This member function returns the Boolean value set by
IloCustomizableGoal::setBestGenerate
.
This member function turns the best generate strategy on and
off for the invoking solver. If the value of best is IloTrue
,
the goal performs a best generate strategy: when an instantiation
x == a
fails, the goal again evaluates all variables to
select a variable. If the value of best is IloFalse
,
the goal does not perform a best generate strategy: when an
instantiation x == a
fails, the goal tries another
value for the same variable x
. The default value is
IloFalse
.