public abstract static class IloCplex.ControlCallback extends IloCplex.MIPCallback
The ControlCallback is not a callback for implementing user
functionality itself, but rather provides the common interface for the above
listed callback classes. These callbacks share the property that they are
called at every node in the branch-and-cut search tree, and allow you to
access node-related data. For each branch-and-cut node these callbacks are
called in the following order:
IloCplex.ControlCallback: Once the node problem has been
solved and IloCplex has added all its cuts, the user cut
callback is called. In case new cuts are added to the problem, the node
problem is solved again. This is iterated until no more cuts are added to the
problem.IloCplex.HeuristicCallback: Once the node has been fully
solved (that is including all the cuts that may have been added), the
heuristic callback is called in an attempt to generate an integer feasible
solution from the current relaxation solution at that node.IloCplex.BranchCallback: Finally, if the relaxation solution
at the current node is either integer infeasible or rejected by the
IloCplex.IncumbentCallback, the problem is split into
subproblems. At that point the IloCplex.BranchCallback can be
used to control how to create the subproblems.
The 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.MIPCallback.NodeData| Constructor and Description |
|---|
IloCplex.ControlCallback() |
| Modifier and Type | Method and Description |
|---|---|
protected double |
getDownPseudoCost(IloNumVar var)
Returns the pseudo cost for branching down on variable
var. |
protected IloCplex.IntegerFeasibilityStatus[] |
getFeasibilities(IloNumVar[] var)
Indicates whether the variables in array
var are integer
feasible, integer infeasible, or implied integer feasible in the current node
solution. |
protected IloCplex.IntegerFeasibilityStatus[] |
getFeasibilities(IloNumVar[] var,
int start,
int num)
Indicates whether the variables specified in array
var are
integer feasible, integer infeasible, or implied integer feasible in the
current node solution. |
protected IloCplex.IntegerFeasibilityStatus |
getFeasibility(IloNumVar var)
Indicates whether the variable
var is integer feasible, integer
infeasible, or implied integer feasible in the current node solution. |
protected double |
getLB(IloNumVar var)
Returns the current lower bound for variable
var. |
protected double[] |
getLBs(IloNumVar[] var)
Returns the current lower bounds for an array of variables.
|
protected double[] |
getLBs(IloNumVar[] var,
int start,
int num)
Returns the current lower bounds for a set of variables.
|
protected java.lang.Object |
getNodeData() |
protected double |
getObjValue()
Returns the objective function value of the solution of the continuous
relaxation of the current node.
|
protected double |
getSlack(IloRange rng)
Returns the slack value of a constraint for the solution of the continuous
relaxation of the current node.
|
protected double[] |
getSlacks(IloRange[] rng)
Returns the slack values of an array of constraints for the solution of the
current node.
|
protected double[] |
getSlacks(IloRange[] rng,
int start,
int num)
Returns the slack values of a set of constraints for the solution of the
current node.
|
protected IloCplex.IntegerFeasibilityStatus |
getSOSFeasibility(ilog.concert.IloSOS1 sos)
Indicates whether the special ordered set of type 1 is integer feasible,
integer infeasible, or implied integer feasible in the current node solution.
|
protected IloCplex.IntegerFeasibilityStatus |
getSOSFeasibility(ilog.concert.IloSOS2 sos)
Indicates whether the special ordered set of type 2 is integer feasible,
integer infeasible, or implied integer feasible in the current node solution.
|
protected double |
getUB(IloNumVar var)
Returns the current upper bound for variable
var. |
protected double[] |
getUBs(IloNumVar[] var)
Returns the current upper bounds for an array of variables.
|
protected double[] |
getUBs(IloNumVar[] var,
int start,
int num)
Returns the current upper bounds for a set of variables.
|
protected double |
getUpPseudoCost(IloNumVar var)
Returns the pseudo cost for branching up on variable
var. |
protected double |
getValue(IloNumExpr expr)
Returns the value
expr takes for the solution of the continuous
relaxation of the current node. |
protected double |
getValue(IloNumVar var)
Returns the solution value of a variable at the current node.
|
protected double[] |
getValues(IloNumVar[] var)
Returns the solution values for an array of variables at the current node.
|
protected double[] |
getValues(IloNumVar[] var,
int start,
int num)
Returns the solution values for a set of variables at the current node.
|
protected java.lang.Object |
setNodeData(java.lang.Object o) |
getObjCoef, getObjCoefs, getObjCoefs, getUserThreadsgetBestObjValue, getCutoff, getDirection, getIncumbentObjValue, getIncumbentValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getMIPRelativeGap, getMyThreadNum, getNiterations, getNnodes, getNremainingNodes, getPriority, hasIncumbentabort, getCplexTime, getDetTime, getEndDetTime, getEndTime, getEnvImpl, getModel, getNcols, getNQCs, getNrows, getStartDetTime, getStartTime, mainprotected java.lang.Object getNodeData()
throws IloException
IloExceptionprotected java.lang.Object setNodeData(java.lang.Object o)
throws IloException
IloExceptionprotected double getLB(IloNumVar var) throws IloException
var. This may be
different from the bound the variable has in the active model, since
branching or bound strengthening may have been applied to it.IloExceptionvar - The variable whose current lower bound is being queried.var at the current node.protected double[] getLBs(IloNumVar[] var) throws IloException
IloExceptionvar - An array of variables whose current lower bounds are being
queried.lb,
lb[j] contains the lower bound of variable var[j] at the
current node.protected double[] getLBs(IloNumVar[] var, int start, int num) throws IloException
IloExceptionvar - An array containing the variables whose current lower bounds are
being queried.start - The index of the first variable in var for which to
query the current lower bound.num - The number of variables in var for which to query
the current lower bounds.lb,
lb[j] contains the lower bound of variable
var[j+start] at the current node, for
j = 0, ..., num-1.protected double getUB(IloNumVar var) throws IloException
var. This may be
different from the bound the variable has in the active model, since
branching or bound strengthening may have been applied to it.IloExceptionvar - The variable whose current upper bound is being queried.var at the current node.protected double[] getUBs(IloNumVar[] var) throws IloException
IloExceptionvar - An array of variables whose current upper bounds are being
queried.ub,
ub[j] contains the upper bound of variable var[j] at the
current node.protected double[] getUBs(IloNumVar[] var, int start, int num) throws IloException
IloExceptionvar - An array containing the variables whose current upper bounds are
being queried.start - The index of the first variable in var for which to
query the current upper bound.num - The number of variables in var for which to query
the current upper bounds.ub,
ub[j] contains the upper bound of variable
var[j+start] at the current node, for
j = 0, ..., num-1.protected double getObjValue()
throws IloException
IloExceptionprotected double getValue(IloNumVar var) throws IloException
IloExceptionvar - The variable whose current solution value is being queried.var at the current node.protected double[] getValues(IloNumVar[] var) throws IloException
IloExceptionvar - An array of variables whose current solution values are being
queried.x, x[j] contains the current
solution value for variable var[j].protected double[] getValues(IloNumVar[] var, int start, int num) throws IloException
IloExceptionvar - An array containing the variables whose current solution values
are being queried.start - The index of the first variable in var for which to
query the current solution values.num - The number of variables in var for which to query
the current solution values.x, x[j] contains the current
solution value for variable var[j+start].protected double getSlack(IloRange rng) throws IloException
IloExceptionrng - The constraint whose current slack value is being queried.rng for the solution of
the continuous relaxation of the current node.protected double[] getSlacks(IloRange[] rng) throws IloException
IloExceptionrng - An array of constraints whose current slack values are being
queried.s,
s[i] contains the current slack value for constraint
rng[i].protected double[] getSlacks(IloRange[] rng, int start, int num) throws IloException
IloExceptionrng - An array containing the constraints whose current slack values
are being queried.start - The index of the first constraint in rng for which
to query the current slack values.num - The number of constraints in rng for which to query
the current slack values.s,
s[i] contains the current slack value for constraint
rng[i+start].protected double getValue(IloNumExpr expr) throws IloException
expr takes for the solution of the continuous
relaxation of the current node.IloExceptionexpr - The expression for which to evaluate the current solution.expr takes for the solution of the continuous
relaxation of the current node.protected double getDownPseudoCost(IloNumVar var) throws IloException
var.IloExceptionvar - The variable whose down pseudo cost is being queried.var.protected double getUpPseudoCost(IloNumVar var) throws IloException
var.IloExceptionvar - The variable whose up pseudo cost is being queried.var.protected IloCplex.IntegerFeasibilityStatus getFeasibility(IloNumVar var) throws IloException
var is integer feasible, integer
infeasible, or implied integer feasible in the current node solution.IloExceptionvar - The variable whose integer feasibility status is being queried.protected IloCplex.IntegerFeasibilityStatus[] getFeasibilities(IloNumVar[] var) throws IloException
var are integer
feasible, integer infeasible, or implied integer feasible in the current node
solution.IloExceptionvar - The array of variables whose integer feasibility status is being
queried.var at the current node. The integer
feasibility status of variable var[j] will be returned
as element j of the returned array.protected IloCplex.IntegerFeasibilityStatus[] getFeasibilities(IloNumVar[] var, int start, int num) throws IloException
var are
integer feasible, integer infeasible, or implied integer feasible in the
current node solution.IloExceptionvar - An array containing the variables whose integer feasibility
status is being queried.start - The index of the first variable in the array var
for which the integer feasibility status are queried.num - The number of variables in the array var, for which
the integer infeasibility statuses are queried.var at the current node. If the
returned array is inf, the feasibility status for
variable var[start+j] will be returned as
inf[j].protected IloCplex.IntegerFeasibilityStatus getSOSFeasibility(ilog.concert.IloSOS1 sos) throws IloException
IloExceptionsos - The SOS1 for which the integer feasibility status is queried.sos.protected IloCplex.IntegerFeasibilityStatus getSOSFeasibility(ilog.concert.IloSOS2 sos) throws IloException
IloExceptionsos - The SOS2 for which the integer feasibility status is queried.sos.