ilog.cplex
Class IloCplex.NetworkCallback

java.lang.Object
  extended byilog.cplex.IloCplex.Callback
      extended byilog.cplex.IloCplex.OptimizationCallback
          extended byilog.cplex.IloCplex.NetworkCallback
All Implemented Interfaces:
java.lang.Cloneable
Enclosing class:
IloCplex

public abstract static class IloCplex.NetworkCallback
extends IloCplex.OptimizationCallback

This is the callback class to use when IloCplex uses the network optimizer.

An instance of the class NetCallback represents a user-written callback in an application that uses an instance of IloCplex with the network optimizer. The callback is executed each time the network optimizer issues a log file message.

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.

See Also:
IloCplex.Callback

Constructor Summary
protected IloCplex.NetworkCallback()
          Constructor for user-written network callback.
 
Method Summary
protected  double getInfeasibility()
          Returns the primal infeasibility measure at the moment the callback is called.
protected  int getNiterations()
          Returns the number of iterations performed by the network optimizer at the moment the callback is called.
protected  double getObjValue()
          Returns the current objective value.
protected  boolean isFeasible()
          Returns a Boolean value reporting whether the current solution is primal feasible at the moment the callback is called.
 
Methods inherited from class ilog.cplex.IloCplex.OptimizationCallback
getModel, getNcols, getNQCs, getNrows
 
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.NetworkCallback

protected IloCplex.NetworkCallback()
Constructor for user-written network callback. This constructor can be called only to construct objects of derived user-written callback classes. It cannot be used to construct IloCplex.NetworkCallback objects directly.

Method Detail

getObjValue

protected double getObjValue()
                      throws IloException
Returns the current objective value. The current objective value is the objective value at the point when the callback is called. In the network simplex method, this objective value may not reflect the objective function defined for the model being solved, but an artificial phase 1 objective function used to achieve primal feasibility. Also, since the network optimizer sees only the embedded network part of the full model, the objective value may not reflect the objective function of the full model.

Returns:
The current objective function value.
Throws:
IloException

getInfeasibility

protected double getInfeasibility()
                           throws IloException
Returns the primal infeasibility measure at the moment the callback is called. If primal feasibility is obtained, the value 0 is returned. Otherwise, this method returns a positive value. Since the network optimizer sees only the embedded network part of the full model, a solution considered to be feasible for the network optimizer may not be so for the full model.

Returns:
The measure of primal infeasibility.
Throws:
IloException

isFeasible

protected boolean isFeasible()
                      throws IloException
Returns a Boolean value reporting whether the current solution is primal feasible at the moment the callback is called. Since the network optimizer sees only the embedded network part of the full model, a solution considered to be feasible for the network optimizer may not be so for the full model.

Returns:
A Boolean value reporting whether the current solution is primal feasible.
Throws:
IloException

getNiterations

protected int getNiterations()
                      throws IloException
Returns the number of iterations performed by the network optimizer at the moment the callback is called.

Returns:
The number of iterations performed by the network optimizer.
Throws:
IloException