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::GoalI<br />
Methods<br />
public void abort()<br />
Abort the optimization, that is, the execution of method solve currently in process.<br />
public static IloCplex::Goal AndGoal(IloCplex::Goal goal1,<br />
IloCplex::Goal goal2)<br />
The static methods AndGoal all return a goal that pushes the goals passed as<br />
parameters onto the goal stack in reverse order. As a consequence, the goals will be<br />
executed in the order they are passed as parameters to the AndGoal function.<br />
public static IloCplex::Goal BranchAsCplexGoal(IloEnv env)<br />
This static function returns a goal that creates the same branches as the currently<br />
selected built-in branch strategy of IloCplex would choose at the current node.<br />
This goal allows you to proceed with the IloCplex search strategy, but keeps the<br />
search under goal control, thereby giving you the option to intervene at any point.<br />
This goal is also important when you use node evaluators while you use a built-in<br />
branching strategy.<br />
For example, consider the execute method of a goal starting like this:<br />
if (!isIntegerFeasible())<br />
return AndGoal(BranchAsCplexGoal(getEnv()), this);<br />
// do something<br />
It would do something only when IloCplex found a solution it considers to be<br />
a candidate for a new incumbent. Note the test of integer feasibility before returning the<br />
BranchAsCplexGoal. Without it, BranchAsCplex would be executed for a<br />
solution IloCplex considers to be feasible, but IloCplex would not know how to<br />
branch on it. An endless loop would result.<br />
public virtual IloCplex::Goal duplicateGoal()<br />
This virtual method must be implemented by the user. It must return a copy of the<br />
invoking goal object. This method may be called by IloCplex when doing parallel<br />
branch & cut search.<br />
public virtual IloCplex::Goal execute()<br />
This virtual method must be implemented by the user to specify the logic of the goal.<br />
The instance of IloCplex::Goal returned by this method will be added to the goal<br />
stack of the node where the invoking goal is being executed for further execution.<br />
public static IloCplex::Goal FailGoal(IloEnv env)<br />
This static method creates a goal that fails. That means that the branch where the goal is<br />
executed will be pruned or, equivalently, the search is discontinued at that node and the<br />
node is discarded.<br />
<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 138