|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ilog.cplex.IloCplex.Callback
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:
main
for this extension. When doing
so, you may use all of the methods defined in the callback class and
its base classes.clone
is not
adequate and the callback is to be used for parallel optimization,
this method also needs to be implemented by the user.
Recall that the
default clone
method performs a shallow copy, so
typically a user implementation would perform a deep copy for
objects that should be local to threads or use the
synchronize
keyword where synchronization is required.
IloCplex
with the method IloCplex.use
.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.
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 |
protected abstract void main() throws IloException
IloException
protected void abort()
main
method to instruct the invoking IloCplex
optimizer to abort the current optimization.
protected ilog.concert.IloModel getModel() throws IloException
IloException
protected int getNrows()
protected int getNQCs()
protected int getNcols()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |