ilog.cplex
Class IloCplex.Callback

java.lang.Object
  |
  +--ilog.cplex.IloCplex.Callback
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
IloCplex.ContinuousCallback, IloCplex.CrossoverCallback, IloCplex.MIPCallback, IloCplex.NetworkCallback, IloCplex.PresolveCallback
Enclosing class:
IloCplex

public abstract static class IloCplex.Callback
extends java.lang.Object
implements java.lang.Cloneable

The callback base class.

This class defines the common interface available to all callback classes. A callback is an object with a method main implemented by the user. This method is called by the IloCplex algorithm at specific points during the optimization. For each of these points, an extension of IloCplex.Callback is provided. To implement and use a particular callback, the following steps must be carried out:

The next time a solution method is executed on the IloCplex object for which the callback has been set, the method main of the callback will be called each time the corresponding point in the optimization algorithm is reached.

The methods of this class are protected to make sure they are used only to derive a user-written callback class or to implement the main method in it.

See Also:
IloCplex.use(ilog.cplex.IloCplex.Callback)

Method Summary
protected  void abort()
          Aborts current optimization.
protected  ilog.concert.IloModel getModel()
          Returns the model being solved when the invoking callback is called, that is the active model.
protected  int getNcols()
          Returns the number of columns of the matrix representation of the active model being solved when the invoking callback is called.
protected  int getNQCs()
          Returns the number of quadratic constraints in the active model being solved when the invoking callback is called.
protected  int getNrows()
          Returns the number of rows of the matrix representation of the active model being solved when the invoking callback is called.
protected abstract  void main()
          The method to be implemented by user callback classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

protected abstract void main()
                      throws IloException
The method to be implemented by user callback classes.

IloException

abort

protected void abort()
Aborts current optimization. This method can be called from a user-written implementation of a main method to instruct the invoking IloCplex optimizer to abort the current optimization.


getModel

protected ilog.concert.IloModel getModel()
                                  throws IloException
Returns the model being solved when the invoking callback is called, that is the active model.

Returns:
The model being solved when the invoking callback is called.
IloException

getNrows

protected int getNrows()
Returns the number of rows of the matrix representation of the active model being solved when the invoking callback is called.

Returns:
The number of rows of the matrix representation of the active model.

getNQCs

protected int getNQCs()
Returns the number of quadratic constraints in the active model being solved when the invoking callback is called.

Returns:
The number of quadratic constraints in the active model.

getNcols

protected int getNcols()
Returns the number of columns of the matrix representation of the active model being solved when the invoking callback is called.

Returns:
The number of columns of the matrix representation of the active model.