Overview | Group | Tree | Graph | Index | Concepts |
The class IlcSearchSelector
represents search selectors
internally in the Solver search. The class IloSearchSelector
represents search selectors in a Concert
Technology model. Search selectors are useful as filters during a Solver
search.
A search selector is an object in Solver. Like other Solver entities, a
search selector is implemented by means of two classes: a handle class and
an implementation class. In other words, an instance of the class
IlcSearchSelector
(a handle) contains a data member (the handle
pointer) that points to an instance of the class
IlcSearchSelectorI
(its implementation object).
A search selector has several purposes:
update
,
updateTo,
and
saveObjectiveValue
.
evaluate
and
isFeasible
.
registerSolution
,
whenFinished
,
getCurrentNode
,
activateNode
, and
closeNode
.A search selector has its own life cycle. To be used internally, it has
to be cloned by the duplicate
member function.
See Also:
IlcSearchNode, IlcSearchSelector
Constructor and Destructor Summary | |
---|---|
public | IlcSearchSelectorI(IloSolver solver, IlcBool duplicate) |
public | ~IlcSearchSelectorI() |
Method Summary | |
---|---|
public void | activateNode(IloSolver solver, IlcSearchNode n) |
public void | closeNode(IlcSearchNode n) |
public virtual IlcSearchSelectorI * | duplicateSelector(IloSolver solver) |
public virtual IlcFloat | evaluate(const IlcSearchNode node) const |
public IlcSearchNode | getCurrentNode(IloSolver solver) |
public virtual IlcBool | isFeasible(IlcFloat eval) const |
public void | saveObjectiveValue(IloSolver solver, IloNum newVal) |
public virtual void | updateObjective(IloSolver solver) |
public virtual void | updateObjectiveTo(IloSolver solver, IloNum newVal) |
public virtual void | whenFinishedTree(IloSolver solver, IlcBool toKill) |
public virtual void | whenLeaf(IloSolver solver) |
Constructor and Destructor Detail |
---|
This constructor creates an instance of the class IlcSearchSelectorI
using
the solver
. The parameter duplicate
indicates whether the object
is an internal copy used by the solver
(duplicate = IlcTrue
), or
if it is just a template. This constructor should not be called directly as this class is an
abstract class. This constructor is called automatically in the constructor of its subclasses.
This destructor is called automatically by the destructor of its subclasses. It frees memory used by the objects.
Method Detail |
---|
This member function should be called only from within the whenFinished
member function.
It indicates that this node n
is in fact selected (which is the purpose of the
IlcSelectSearch
function).
This member function deletes a node n
obtained with the getCurrentNode member function.
This member function is called internally to duplicate the current search selector. When you use this
member function, the duplicate
parameter in the IlcSearchSelectorI
constructor
should be equal to IlcTrue
.
This member function evaluates the node given as a parameter. This evaluation will be used by
the isFeasible
member function. Its purpose is to prune nodes before the solver jumps to them.
When you implement this virtual member function yourself, you should make sure that your
implementation is independent of the state of the solver (the instance of IloSolver
where the invoking search selector is working). The signature of this member function includes
const
for that reason to avoid accumulated effects of multiple calls of this member function.
This member function returns a copy of the current search node. It should be called only from the
registerSolution
member function. To discard a node obtained by this member function,
you must use the closeNode
member function.
This member function uses the eval
parameter which comes from the evaluate
member function. A return value of IlcFalse
indicates that it is safe to discard this node
and not to evaluate it. The return value IlcTrue
indicates that the node will be kept.
When you implement this virtual member function yourself, you should make sure that your implementation
is independent of the state of the solver (the instance of IloSolver
where the invoking search
selector is working). The signature of this member function includes const
for that reason to
avoid accumulated effects of multiple calls of this member function.
This member function is called by the solver when it arrives at a leaf of the search tree
associated with the goal given as a parameter to the IlcSelectSearch
function.
It may use the member functions getCurrentNode
and closeNode
.
This member function is used to implement a minimization process. It checks whether a better
upper bound on the objective is known. If this is the case, it adds the corresponding constraint
and saves the information using the saveObjectiveValue
member function.
This member function is called during recomputation. It adds the same constraint as was
posted by the update
member function. The parameter newVal
is the
one which was saved by the saveObjectiveValue
member function.
This member function is called by the solver
when it has completely explored the search
tree associated with the goal given as a parameter to the IlcSelectSearch
function. It
may use the member functions closeNode
and activateNode
.
The expected behavior depends on the parameter toKill
. If toKill
is equal
to IlcFalse
(which is the usual case), the search selector proceeds normally. If
toKill
is equal to IlcTrue
, the search selector must not activate any
of the stored nodes, but must kill them all using the closeNode
member function.
This member function is called by the solver
when it arrives at a leaf of the search
tree associated with the goal given as a parameter to the IlcSelectSearch
function. It
may use the member functions getCurrentNode
and closeNode
.