|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ilog.cplex.IloCplex.Callback | +--ilog.cplex.IloCplex.MIPCallback
The base class for all MIP callbacks.
An instance of the class MIPCallback
represents a
user-written callback in an application that uses an instance of
IloCplex
to solve a mixed integer program (MIP).
IloCplex
calls the user-written callback prior to solving
each node in the branch-and-cut search. This class allows you to
access an incumbent solution, an incumbent node, and an incumbent
objective value from a user-written callback. It also allows you to
access priority orders and statistical information such as the number
of cuts that have been generated. Methods are also available to query
the number of generated cuts for each type of cut CPLEX generates.
See the ILOG CPLEX User's Manual for more information about
cuts.
This class also provides a common application programming interface (API) for these subclasses:
IloCplex.DisjunctiveCutCallback
IloCplex.FractionalCutCallback
IloCplex.FlowMIRCutCallback
IloCplex.ProbingCallback
IloCplex.IncumbentCallback
IloCplex.NodeCallback
IloCplex.SolveCallback
IloCplex.ControlCallback
with its extensions:
IloCplex.CutCallback
IloCplex.BranchCallback
IloCplex.HeuristicCallback
The constructor and methods of this class are protected to
make sure that they
are used only to derive a user-written callback class or to implement
the main
method in it.
IloCplex.Callback
Constructor Summary | |
protected |
IloCplex.MIPCallback()
Constructor for user-written MIP callback. |
Method Summary | |
protected double |
getBestObjValue()
This method returns a bound on the optimal solution value of the active problem at the moment the callback is called. |
protected double |
getCutoff()
Returns the cutoff for the objective value when nodes are being solved during branch-and-cut search. |
protected IloCplex.BranchDirection |
getDirection(ilog.concert.IloNumVar var)
Returns the branch direction for variable var . |
protected double |
getIncumbentObjValue()
Returns the objective value of the current best integer solution at the moment the callback is called. |
protected double |
getIncumbentValue(ilog.concert.IloNumVar var)
Returns the value of var for the current best integer
solution. |
protected double[] |
getIncumbentValues(ilog.concert.IloNumVar[] vars)
Returns incumbent solution values for an array of variables. |
protected double[] |
getIncumbentValues(ilog.concert.IloNumVar[] vars,
int start,
int num)
Returns the incumbent solution values for a set of variables. |
protected int |
getMyThreadNum()
|
protected int |
getNcliques()
Returns the number of clique cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNcovers()
Returns the number of cover cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNdisjunctiveCuts()
Returns the number of disjunctive cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNflowCovers()
Returns the number of flow cover cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNflowPaths()
Returns the number of flow path cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNfractionalCuts()
Returns the number of fractional cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNGUBcovers()
Returns the number of GUB cover cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNimpliedBounds()
Returns the number of implied bound cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNiterations()
Returns the total number of iterations for solving node relaxations during the current optimization. |
protected int |
getNMIRs()
Returns the number of mixed integer rounding (MIR) cuts that have been added to the node relaxation at the moment the callback is called. |
protected int |
getNnodes()
Returns the number of nodes processed so far in the active branch-and-cut search. |
protected int |
getNremainingNodes()
Returns the number of nodes remaining to be processed, or, equivalently, the number of active nodes in the tree. |
protected double |
getObjCoef(ilog.concert.IloNumVar var)
Returns the linear objective function coefficient for variable var in the model being solved. |
protected double[] |
getObjCoefs(ilog.concert.IloNumVar[] vars)
Returns the linear objective function coefficients for an array of variables in the model being solved. |
protected double[] |
getObjCoefs(ilog.concert.IloNumVar[] vars,
int start,
int num)
Returns the linear objective function coefficients for a set of variables in the model being solved. |
protected int |
getPriority(ilog.concert.IloNumVar var)
Returns the branch priority for variable var . |
protected int |
getUserThreads()
|
protected boolean |
hasIncumbent()
Returns true if an incumbent solution has been found when
the callback is called. |
Methods inherited from class ilog.cplex.IloCplex.Callback |
abort, getModel, getNcols, getNQCs, getNrows, main |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected IloCplex.MIPCallback()
IloCplex.MIPCallback
objects directly.
Method Detail |
protected int getMyThreadNum() throws IloException
IloException
protected int getUserThreads() throws IloException
IloException
protected double getBestObjValue() throws IloException
IloException
- If the method fails, an exception
of type IloException
, or
one of its derived classes, is thrown.protected double getCutoff() throws IloException
IloException
protected double getIncumbentObjValue() throws IloException
IloException
protected double getIncumbentValue(ilog.concert.IloNumVar var) throws IloException
var
for the current best integer
solution.
This method returns the value of variable var
in the
current incumbent solution (that is, the best integer solution found so
far).
var
- The variable whose incumbent solution value is being queried.
var
in the current
incumbent solution.
IloException
protected double[] getIncumbentValues(ilog.concert.IloNumVar[] vars) throws IloException
vars
- The array of variables whose
incumbent solution values are being queried.
var
.
The solution value for variable var[j]
is
returned as element j
of the returned array.
IloException
protected double[] getIncumbentValues(ilog.concert.IloNumVar[] vars, int start, int num) throws IloException
vars
- An array containing the variables whose
incumbent solution values are being queried.start
- The index of the first variable in vars
for which to return the incumbent solution value.num
- The number of variables in vars
for which
to return the incumbent solution values.
var
. The solution for variable
var[j+start]
is returned as element
j
of the returned array.
IloException
protected boolean hasIncumbent() throws IloException
true
if an incumbent solution has been found when
the callback is called.
true
if an incumbent solution has been found.
IloException
protected int getNnodes() throws IloException
IloException
protected int getNremainingNodes() throws IloException
IloException
protected int getNiterations() throws IloException
IloException
protected int getNcliques() throws IloException
IloException
protected int getNcovers() throws IloException
IloException
protected int getNflowCovers() throws IloException
IloException
protected int getNflowPaths() throws IloException
IloException
protected int getNGUBcovers() throws IloException
IloException
protected int getNfractionalCuts() throws IloException
IloException
protected int getNdisjunctiveCuts() throws IloException
IloException
protected int getNMIRs() throws IloException
IloException
protected int getNimpliedBounds() throws IloException
IloException
protected IloCplex.BranchDirection getDirection(ilog.concert.IloNumVar var) throws IloException
var
.
var
- The variable whose branch direction is being queried.
var
.
IloException
protected int getPriority(ilog.concert.IloNumVar var) throws IloException
var
.
var
- The variable whose branch priority is being queried.
var
IloException
protected double getObjCoef(ilog.concert.IloNumVar var) throws IloException
var
in the model being solved.
var
- The variable whose linear objective
coefficient is being queried.
var
in the model being solved.
IloException
protected double[] getObjCoefs(ilog.concert.IloNumVar[] vars) throws IloException
obj
, obj[j]
is the linear objective function coefficient for
variable var[j]
.
IloException
protected double[] getObjCoefs(ilog.concert.IloNumVar[] vars, int start, int num) throws IloException
start
- The index of the first variable in var
for
which to query the linear objective function coefficients.num
- The number of variables in var
for which to
query the linear objective function coefficients.
obj
is the returned array, obj[j]
is the
linear objective function coefficient for variable
var[j+start]
, for
j = 0, ..., num-1
.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |