public abstract static class IloCplex.IncumbentCallback extends IloCplex.MIPCallback
IloCplex will
continue the branch-and-cut search. However, since CPLEX consideres the
current node solution to be integer feasible, it will not be able to
determine a reasonable way to branch. Thus, when this callback is implemented
in such a way that it may reject an incumbent, it is typically paired with a
branch callback to perform the branching after an incumbent has been
rejected.
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.MIPCallbackIloCplex.MIPCallback.NodeData| Modifier | Constructor and Description |
|---|---|
protected |
IloCplex.IncumbentCallback()
Constructor for user-written incumbent callback.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
getNodeData()
Returns the user object attached to the current node.
|
protected IloCplex.NodeId |
getNodeId()
Returns the node identifier of the current node.
|
protected double |
getObjValue()
Returns the objective value of the potential incumbent.
|
protected double |
getSlack(IloRange rng)
Returns the slack value of a constraint for the proposed incumbent solution.
|
protected double[] |
getSlacks(IloRange[] rng)
Returns the slack values for an array of constraints for the proposed
incumbent solution.
|
protected double[] |
getSlacks(IloRange[] rng,
int start,
int num)
Returns the slack values for a set of constraints for the proposed incumbent
solution.
|
protected double |
getValue(IloNumExpr expr)
Returns the value
expr takes for the proposed incumbent
solution. |
protected double |
getValue(IloNumVar var)
Returns the value of the variable
var in the potential incumbent
solution. |
protected double[] |
getValues(IloNumVar[] var)
Returns the values of variables in the array
var in the
potential incumbent solution. |
protected double[] |
getValues(IloNumVar[] var,
int start,
int num)
Returns the values of
num variables in the array
var of variables in the potential incumbent solution. |
protected void |
reject()
Rejects the proposed incumbent solution.
|
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 IloCplex.IncumbentCallback()
IloCplex.IncumbentCallback objects
directly.protected double getObjValue()
throws IloException
IloExceptionprotected double getValue(IloNumVar var) throws IloException
var in the potential incumbent
solution.IloExceptionvar - The variable whose value is to be returned.var in the potential incumbent solution.protected double[] getValues(IloNumVar[] var) throws IloException
var in the
potential incumbent solution.IloExceptionvar - The array of variables whose values are required.var. If the the returned array is
val, val[j] is the proposed incumbent value
for variable var[j].protected double[] getValues(IloNumVar[] var, int start, int num) throws IloException
num variables in the array
var of variables in the potential incumbent solution.IloExceptionvar - The array containing the variables whose proposed incumbent
values are being queried.start - The index of the first variable in array var for
which the proposed incumbent value is requested.num - The number of variables in array var for which the
proposed incumbent value is requested.var. If the returned
array is val, val[j] is the proposed
incumbent value for variable var[j+start].protected double getValue(IloNumExpr expr) throws IloException
expr takes for the proposed incumbent
solution.IloExceptionexpr - The expression for which to evaluate the proposed incumbent
solution.expr takes for the solution of the proposed
incumbent solution.protected double getSlack(IloRange rng) throws IloException
IloExceptionrng - The constraint whose slack value is being queried.rng for the proposed
incumbent solution.protected double[] getSlacks(IloRange[] rng) throws IloException
IloExceptionrng - An array of constraints whose slack values are being queried.s, s[i] contains
the slack value for constraint rng[i].protected double[] getSlacks(IloRange[] rng, int start, int num) throws IloException
IloExceptionrng - An array containing the constraints whose slack values are being
queried.start - The index of the first constraint in rng for which
to query the slack values.num - The number of constraints in rng for which to query
the slack values.s, s[i] contains
the slack value for constraint rng[i+start].protected IloCplex.NodeId getNodeId() throws IloException
IloExceptionprotected java.lang.Object getNodeData()
throws IloException
IloCplex.BranchCallback.makeBranch in a branch callback.IloExceptionnull will be returned.protected java.lang.Object setNodeData(java.lang.Object o)
throws IloException
IloExceptionprotected void reject()