ILOG CPLEX C++ API 9.0 Reference Manual
ILOG CPLEX C++ API 9.0 Reference Manual
ILOG CPLEX C++ API 9.0 Reference Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
IloCplex::NodeEvaluatorI<br />
To implement your own node evaluator, you need to create a subclass of<br />
IloCplex::NodeEvaluatorI and implement methods evaluate and<br />
duplicateEvaluator. The method evaluate must be implemented to compute<br />
and return a value for a given node. The protected methods of class<br />
IloCplex::NodeEvaluatorI can be called to query information about the node<br />
in order to compute this value. Each node is evaluated only once, after which the value is<br />
attached to the node until the node is processed or pruned.<br />
The duplicateEvaluator method is called by IloCplex when a copy of the<br />
evaluator must be created for use in parallel branch & cut search. Thus the<br />
implementation must simply create and return a copy of the evaluator itself—calling the<br />
copy constructor will work in most circumstances.<br />
Node evaluators are applied to a search defined by a goal with the method<br />
IloCplex::Apply. The node selection strategy will be applied only to the subtree<br />
defined by the goal passed to Apply. Using IloCplex::Apply, you can assign<br />
different node selection strategies to different subtrees. You can also assign multiple<br />
node selection strategies to subtrees. In this case, node selection strategies applied first<br />
have precedence over those assigned later.<br />
If no node evaluators are added, IloCplex uses the node selection strategy as<br />
controlled by the NodeSel parameter.<br />
See Also<br />
Constructors<br />
Methods<br />
IloCplex, IloCplex::NodeEvaluator<br />
public NodeEvaluatorI()<br />
This constructor creates a node selector for use in an application with a user-defined<br />
node selection strategy to solve a MIP.<br />
public virtual NodeEvaluatorI * duplicateEvaluator()<br />
This method must be implemented by the user to return a copy of the invoking object. It<br />
is called internally to duplicate the current node evaluator for parallel branch & cut<br />
search. This method is not called for a particular node, so the get methods cannot be<br />
used.<br />
public virtual IloNum evaluate()<br />
This method must be implemented by the user to return a value for a given node. When<br />
this method is called, the node evaluator is initialized to the node for which to compute<br />
the value. Information about this node can be obtained by the get methods of<br />
IloCplex::NodeEvaluatorI. Returning IloInfinity instructs IloCplex<br />
to discard the node being evaluated.<br />
protected IloNumVar getBranchVar()<br />
This method returns the variable that IloCplex branched on when creating the node<br />
being evaluated from its parent. If the node has been generated with a more complex<br />
<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 195