|
||||||||||
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.ControlCallback
This is the base class for all callback classes that allow you to query or take control of the MIP branch-and-cut search. These classes are:
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.CutCallback
: 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.Callback
,
IloCplex.MIPCallback
,
IloCplex.BranchCallback
,
IloCplex.CutCallback
,
IloCplex.HeuristicCallback
Constructor Summary | |
IloCplex.ControlCallback()
|
Method Summary | |
protected double |
getDownPseudoCost(ilog.concert.IloNumVar var)
Returns the pseudo cost for branching down on variable var . |
protected IloCplex.IntegerFeasibilityStatus[] |
getFeasibilities(ilog.concert.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(ilog.concert.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(ilog.concert.IloNumVar var)
Indicates whether the variable var is integer feasible,
integer infeasible, or implied integer feasible in the current node
solution. |
protected double |
getLB(ilog.concert.IloNumVar var)
Returns the current lower bound for variable var . |
protected double[] |
getLBs(ilog.concert.IloNumVar[] var)
Returns the current lower bounds for an array of variables. |
protected double[] |
getLBs(ilog.concert.IloNumVar[] var,
int start,
int num)
Returns the current lower bounds for a set of variables. |
protected java.lang.Object |
getNodeData()
Returns the user object attached to the current node. |
protected double |
getObjValue()
Returns the objective function value of the solution of the continuous relaxation of the current node. |
protected double |
getSlack(ilog.concert.IloRange rng)
Returns the slack value of a constraint for the solution of the continuous relaxation of the current node. |
protected double[] |
getSlacks(ilog.concert.IloRange[] rng)
Returns the slack values of an array of constraints for the solution of the current node. |
protected double[] |
getSlacks(ilog.concert.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(ilog.concert.IloNumVar var)
Returns the current upper bound for variable var . |
protected double[] |
getUBs(ilog.concert.IloNumVar[] var)
Returns the current upper bounds for an array of variables. |
protected double[] |
getUBs(ilog.concert.IloNumVar[] var,
int start,
int num)
Returns the current upper bounds for a set of variables. |
protected double |
getUpPseudoCost(ilog.concert.IloNumVar var)
Returns the pseudo cost for branching up on variable var . |
protected double |
getValue(ilog.concert.IloNumExpr expr)
Returns the value expr takes for the solution of the
continuous relaxation of the current node. |
protected double |
getValue(ilog.concert.IloNumVar var)
Returns the solution value of a variable at the current node. |
protected double[] |
getValues(ilog.concert.IloNumVar[] var)
Returns the solution values for an array of variables at the current node. |
protected double[] |
getValues(ilog.concert.IloNumVar[] var,
int start,
int num)
Returns the solution values for a set of variables at the current node. |
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 |
public IloCplex.ControlCallback()
Method Detail |
protected double getLB(ilog.concert.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.
var
- The variable whose current lower bound is being queried.
var
at the
current node.
IloException
protected double[] getLBs(ilog.concert.IloNumVar[] var) throws IloException
var
- 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.
IloException
protected double[] getLBs(ilog.concert.IloNumVar[] var, int start, int num) throws IloException
var
- 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
.
IloException
protected double getUB(ilog.concert.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.
var
- The variable whose current upper bound is being queried.
var
at the
current node.
IloException
protected double[] getUBs(ilog.concert.IloNumVar[] var) throws IloException
var
- 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.
IloException
protected double[] getUBs(ilog.concert.IloNumVar[] var, int start, int num) throws IloException
var
- 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
.
IloException
protected double getObjValue() throws IloException
IloException
protected double getValue(ilog.concert.IloNumVar var) throws IloException
var
- The variable whose current solution value is being
queried.
var
at
the current node.
IloException
protected double[] getValues(ilog.concert.IloNumVar[] var) throws IloException
var
- An array of variables whose current
solution values are being queried.
x
,
x[j]
contains the current solution value
for variable var[j]
.
IloException
protected double[] getValues(ilog.concert.IloNumVar[] var, int start, int num) throws IloException
var
- 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]
.
IloException
protected double getSlack(ilog.concert.IloRange rng) throws IloException
rng
- The constraint whose current slack
value is being queried.
rng
for
the solution of the continuous relaxation of the current
node.
IloException
protected double[] getSlacks(ilog.concert.IloRange[] rng) throws IloException
rng
- An array of constraints whose current
slack values are being queried.
s
,
s[i]
contains the current 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
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]
.
IloException
protected double getValue(ilog.concert.IloNumExpr expr) throws IloException
expr
takes for the solution of the
continuous relaxation of the current node.
expr
- The expression for which to evaluate the current solution.
expr
takes for the solution of the
continuous relaxation of the current node.
IloException
protected double getDownPseudoCost(ilog.concert.IloNumVar var) throws IloException
var
.
var
- The variable whose down pseudo cost is being queried.
var
.
IloException
protected double getUpPseudoCost(ilog.concert.IloNumVar var) throws IloException
var
.
var
- The variable whose up pseudo cost is being queried.
var
.
IloException
protected IloCplex.IntegerFeasibilityStatus getFeasibility(ilog.concert.IloNumVar var) throws IloException
var
is integer feasible,
integer infeasible, or implied integer feasible in the current node
solution.
var
- The variable whose integer feasibility status is
being queried.
IloException
protected IloCplex.IntegerFeasibilityStatus[] getFeasibilities(ilog.concert.IloNumVar[] var) throws IloException
var
are integer feasible, integer infeasible, or implied
integer feasible in the current node solution.
var
- 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.
IloException
protected IloCplex.IntegerFeasibilityStatus[] getFeasibilities(ilog.concert.IloNumVar[] var, int start, int num) throws IloException
var
are integer feasible, integer infeasible, or implied
integer feasible in the current node solution.
var
- 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]
.
IloException
protected IloCplex.IntegerFeasibilityStatus getSOSFeasibility(ilog.concert.IloSOS1 sos) throws IloException
sos
- The SOS1 for which the integer feasibility status is
queried.
sos
.
IloException
protected IloCplex.IntegerFeasibilityStatus getSOSFeasibility(ilog.concert.IloSOS2 sos) throws IloException
sos
- The SOS2 for which the integer feasibility status is
queried.
sos
.
IloException
protected java.lang.Object getNodeData() throws IloException
IloCplex.BranchCallback.makeBranch
in a branch callback.
null
will
be returned.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |