Terminating without callbacks
Describes ways to terminate optimization without a callback.
If you simply want to terminate optimization under circumstances defined by your application, then you do not necessarily need to write a callback to do so. Instead, you can invoke termination by these means:
In the C++ API, pass an instance of the class
IloCplex::Aborterto an instance ofIloCplex. Then call the methodIloCplex::Aborter::abortto terminate optimization.In the Java API, pass an instance of the class
IloCplex.Aborterto an instance ofIloCplex. Then call the methodIloCplex.Aborter.abortto terminate optimization.In the .NET API, pass an instance of the class
Cplex.Aborterto an instance ofCplex. Then call the methodCplex.Aborter.Abortto terminate optimization.In the Callable Library (C API), call the routine
CPXsetterminateto set a pointer to the termination signal. Initially, the value of the termination signal should be zero. When your application sets the termination signal to a nonzero value, then CPLEX will terminate optimization.In the Python API, use the
Aborterclass to terminate optimization. See mipex4.py for an example.