|
||||||||||
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.NodeCallback
This is the base class for user-written callbacks that allow the user to select the node to process next during the branch-and-cut search.
Node callbacks allow you to determine which node from among the
unexplored nodes IloCplex
will chose to explore next in the
branch-and-cut search. They aslo give you the option to override this
selection.
When an instance of this callback class executes, the invoking instance of
IloCplex
still has n = getNremainingNodes
(inherited from MIPCallback
) nodes left to process. These
remaining nodes are numbered from 0
(zero) to
n-1
. For that reason, the same node may have a different
number each time an instance of NodeCallback
is called. To
identify a node uniquely, an instance of IloCplex
also
assigns a unique identifier
(IloCplex.NodeId
) to each node. That unique
identifier remains unchanged throughout the search. The method
getNodeId(int i)
allows you to access the
IloCplex.NodeId
for each of the remaining
nodes 0
to n-1
. Similarly, the method getNodeNumber
returns the number of a node specified by its
IloCplex.NodeId
.
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.NodeCallback()
This is the constructor for user-written node callbacks. |
Method Summary | |
protected ilog.concert.IloNumVar |
getBranchVar(int node)
Returns the variable that was branched upon to create the node specified by number node . |
protected int |
getDepth(int node)
Returns the depth of the node in the search tree. |
protected double |
getEstimatedObjValue(int node)
Returns the estimated objective value for the node indicated by the node number node . |
protected double |
getInfeasibilitySum(int node)
Returns the sum of integer infeasibility of the node indicated by the node number node . |
protected int |
getNinfeasibilities(int node)
Returns the number of integer infeasible variables for the node indicated by the node number node . |
protected java.lang.Object |
getNodeData(int node)
Returns the user object attached to the node with number node . |
protected IloCplex.NodeId |
getNodeId(int node)
Returns the node identifier of the node indicated by the node number node . |
protected int |
getNodeNumber(IloCplex.NodeId nodeid)
Returns the node number of the node indicated by the node identifier nodeid . |
protected double |
getObjValue(int node)
Returns the objective value of the node indicated by the node number node . |
protected void |
selectNode(int node)
Selects the next node to be processed by its number. |
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.NodeCallback()
IloCplex.NodeCallback
objects directly.
Method Detail |
protected IloCplex.NodeId getNodeId(int node) throws IloException
node
. An instance of IloCplex
numbers the nodes that remain to be explored in the branch and cut
sequentially from 0
(zero) to
getNremainingNodes()-1
. However, when a node is created
during search, it also assigns a unique IloCplex.NodeId
to it. This method allows you to query this
IloCplex.NodeId
for all unexplored nodes.
node
- The node number of the node for which the node
identifier is queried.
IloCplex.NodeId
of the specified node.
IloException
protected double getObjValue(int node) throws IloException
node
.
node
- The number of the node for which the objective
value is requested.
node
.
IloException
protected double getEstimatedObjValue(int node) throws IloException
node
.
node
- The number of the node for which the estimated
objective value is requested.
node
.
IloException
protected int getDepth(int node) throws IloException
0
(zero); the depth of other nodes
is their distance from the root or, equivalently, the number of
branches needed to reach that node from the root.
node
- The node number of the node whose depth is being queried.
node
.
IloException
protected double getInfeasibilitySum(int node) throws IloException
node
.
node
- The node number of the node whose infeasibility sum
is being queried.
node
.
IloException
protected int getNinfeasibilities(int node) throws IloException
node
.
node
- The node number of the node whose
number of integer infeasibilities is being queried.
node
.
IloException
protected void selectNode(int node) throws IloException
Selects the node indicated by number node
as
the next node to process in the branch-and-cut search. The parameter
node
is the node number of the node to selected and must
be between 0
(zero) and
getNremainingNodes()-1
.
The invoking instance of IloCplex
uses the specified node
as the next node to process.
node
- The number of the node you want to be processed next.
IloException
protected ilog.concert.IloNumVar getBranchVar(int node) throws IloException
node
. If that node has
been created by branching on a constraint or on multiple
variables, null
will be returned.
node
- The number of the node from which you want to
obtain the variable.
node
.
IloException
protected java.lang.Object getNodeData(int node) throws IloException
node
. User objects can be attached to a node when the
node is created with method
IloCplex.BranchCallback.makeBranch
in a branch
callback.
node
. If no user object is attached to the
current node, null
will be returned.
IloException
protected int getNodeNumber(IloCplex.NodeId nodeid) throws IloException
nodeid
.
An instance of IloCplex
assigns node identifiers to nodes when it creates them while branching.
Within a search, these node identifiers are unique throughout the
duration of that search. However, the remaining nodes are implicitely
numbered starting from 0 (zero) at each node.
This method returns the number that
the node with the specified identifier has within that local numbering.
nodeid
- The node identifier of the for which to query the ndoe
number.
IloException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |