|
||||||||||
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 | +--ilog.cplex.IloCplex.IncumbentCallback
This callback class is called whenever a new potential incumbent is found
during the branch-and-cut search. It allows you to analyze the proposed
incumbent and optionally reject it. In this case, 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.MIPCallback
Constructor Summary | |
protected |
IloCplex.IncumbentCallback()
Constructor for user-written incumbent callback. |
Method Summary | |
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(ilog.concert.IloRange rng)
Returns the slack value of a constraint for the proposed incumbent solution. |
protected double[] |
getSlacks(ilog.concert.IloRange[] rng)
Returns the slack values for an array of constraints for the proposed incumbent solution. |
protected double[] |
getSlacks(ilog.concert.IloRange[] rng,
int start,
int num)
Returns the slack values for a set of constraints for the proposed incumbent solution. |
protected double |
getValue(ilog.concert.IloNumExpr expr)
Returns the value expr takes for the
proposed incumbent solution. |
protected double |
getValue(ilog.concert.IloNumVar var)
Returns the value of the variable var in the potential
incumbent solution. |
protected double[] |
getValues(ilog.concert.IloNumVar[] var)
Returns the values of variables in the array var
in the potential incumbent solution. |
protected double[] |
getValues(ilog.concert.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. |
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.IncumbentCallback()
IloCplex.IncumbentCallback
objects directly.
Method Detail |
protected double getObjValue() throws IloException
IloException
protected double getValue(ilog.concert.IloNumVar var) throws IloException
var
in the potential
incumbent solution.
var
- The variable whose value is to be returned.
var
in the potential incumbent
solution.
IloException
protected double[] getValues(ilog.concert.IloNumVar[] var) throws IloException
var
in the potential incumbent solution.
var
- 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]
.
IloException
protected double[] getValues(ilog.concert.IloNumVar[] var, int start, int num) throws IloException
num
variables in the array
var
of variables in the potential incumbent solution.
var
- 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]
.
IloException
protected double getValue(ilog.concert.IloNumExpr expr) throws IloException
expr
takes for the
proposed incumbent solution.
expr
- The expression for which to evaluate the proposed
incumbent solution.
expr
takes for the solution
of the proposed incumbent solution.
IloException
protected double getSlack(ilog.concert.IloRange rng) throws IloException
rng
- The constraint whose slack value is being queried.
rng
for the
proposed incumbent solution.
IloException
protected double[] getSlacks(ilog.concert.IloRange[] rng) throws IloException
rng
- An array of constraints whose slack values
are being queried.
s
, s[i]
contains the
slack value for constraint rng[i]
.
IloException
protected double[] getSlacks(ilog.concert.IloRange[] rng, int start, int num) throws IloException
rng
- 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]
.
IloException
protected IloCplex.NodeId getNodeId() throws IloException
IloException
protected java.lang.Object getNodeData() throws IloException
IloCplex.BranchCallback.makeBranch
in a branch callback.
null
will
be returned.
IloException
protected void reject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |