ilog.cplex
Class IloCplex.NodeCallback

java.lang.Object
  |
  +--ilog.cplex.IloCplex.Callback
        |
        +--ilog.cplex.IloCplex.MIPCallback
              |
              +--ilog.cplex.IloCplex.NodeCallback

public abstract static class IloCplex.NodeCallback
extends IloCplex.MIPCallback

A class to identify which node will next be selected for branch and cut. An instance of the class NodeCallback represents a user-written callback in an application that uses an instance of IloCplex. The methods of this class enable you (from a user-derived callback class) to query the instance of IloCplex about the next node that it plans to select in the branch and cut. There are also methods in this class that enable you to select a node as the next node to process in the branch and cut from a user-derived callback class.

When an instance of this callback 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 NodeId to each node. That unique identifier remains unchanged throughout the search. The method getNodeId(int i) allows you to access the NodeId for each of the remaining nodes 0 to n-1. Such a query allows you to associate data with individual nodes.

The methods of this class are protected for use in deriving a user-written callback class and in implementing the main method in it.

If an attempt is made to access information not available to an instance of this class, an exception is thrown.

See Also:
IloCplex.MIPCallback

Constructor Summary
protected IloCplex.NodeCallback()
           
 
Method Summary
protected  IloNumVar getBranchVar(int node)
          Gets the variable at a node.
protected  int getDepth(int node)
          Gets the depth of the node in the search tree.
protected  double getEstimatedObjValue(int node)
          Gets the estimated objective value at the node indicated by the index number node.
protected  double getInfeasibilitySum(int node)
          Gets the sum of infeasibility measures at the node indicated by the index number node.
protected  int getNinfeasibilities(int node)
          Gets the number of infeasibilities at the node indicated by the index number node.
protected  IloCplex.NodeId getNodeId(int node)
          Gets the node identifier of the node indicated by the index number node.
protected  double getObjValue(int node)
          Gets the objective value at the node indicated by the index number node.
protected  void selectNode(int node)
          Selects the next node to be processed by its index number.
 
Methods inherited from class ilog.cplex.IloCplex.MIPCallback
getBestObjValue, getCutoff, getDirection, getIncumbentObjValue, getIncumbentValue, getIncumbentValues, getIncumbentValues, getNcliques, getNcovers, getNdisjunctiveCuts, getNflowCovers, getNflowPaths, getNfractionalCuts, getNGUBcovers, getNimpliedBounds, getNiterations, getNMIRs, getNnodes, getNremainingNodes, getPriority, isIntegerFeasible
 
Methods inherited from class ilog.cplex.IloCplex.Callback
abort, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IloCplex.NodeCallback

protected IloCplex.NodeCallback()
Method Detail

getNodeId

protected IloCplex.NodeId getNodeId(int node)
Gets the node identifier of the node indicated by the index number node. An instance of IloCplex numbers the nodes in the branch and cut sequentially from 0 (zero) to numberOfNodes - 1 as it creates nodes. Within a search, these node numbers are unique throughout the duration of that search.
Parameters:
node - The index number of the node for which the node identifier is required.
Returns:
The unique node identifier for node.

getObjValue

protected double getObjValue(int node)
Gets the objective value at the node indicated by the index number node.
Parameters:
node - The index number of the node for which the node identifier is required.
Returns:
The objective value at node index node.

getEstimatedObjValue

protected double getEstimatedObjValue(int node)
Gets the estimated objective value at the node indicated by the index number node.
Parameters:
node - The index number of the node for which the node identifier is required.
Returns:
The estimated object value at node index node.

getDepth

protected int getDepth(int node)
Gets the depth of the node in the search tree. The root node is depth 0 (zero); the depth of other nodes is their distance from the root.
Parameters:
node - The index number of the node for which the node identifier is required.
Returns:
The depth of the node index node.

getInfeasibilitySum

protected double getInfeasibilitySum(int node)
Gets the sum of infeasibility measures at the node indicated by the index number node.
Parameters:
node - The index number of the node for which the node identifier is required.
Returns:
The sum of the infeasibility measures at node index node.

getNinfeasibilities

protected int getNinfeasibilities(int node)
Gets the number of infeasibilities at the node indicated by the index number node.
Parameters:
node - The index number of the node at which the to find the number of infeasibilities.
Returns:
The number of the infeasibilities at node index node.

selectNode

protected void selectNode(int node)
Selects the next node to be processed by its index number. Selects the node indicated by its index number node and sets it as the next node to process in the branch and cut. The parameter node must be an integer between 0 (zero) and getNremainingNodes - 1.

The invoking instance of IloCplex uses the specified node as the next node to process.

Parameters:
node - The index number of the node you want to be processed.

getBranchVar

protected IloNumVar getBranchVar(int node)
                          throws IloException
Gets the variable at a node. Gets the variable corresponding to the node indicated by the index number node.
Parameters:
node - The index number of the node from which you want to obtain the variable.
Returns:
The branch variable corresponding to the node node.