Package cplex :: Module aborter :: Class Aborter
 

Class Aborter

Gracefully terminates the solve and tuning methods of CPLEX.

You can pass an instance of this class to one or more Cplex objects.

Calling the method abort() will then terminate the solve or tuning method of the Cplex object.

Instance Methods
 
__init__(self)
Constructor of the Aborter class.
 
abort(self)
Aborts the solving and tuning methods.
 
clear(self)
Clears the invoking aborter.
 
is_aborted(self)
Returns True if the method to abort has been called.
 
end(self)
Ends the invoking aborter.
 
__del__(self)
 
__enter__(self)
Enter the runtime context related to this object.
 
__exit__(self, exc_type, exc_value, traceback)
Exit the runtime context.
Method Details

__init__(self)
(Constructor)

 

Constructor of the Aborter class.

The Aborter object is a context manager and can be used, like so:

with Aborter() as aborter:
# do stuff

When the with block is finished, the end() method will be called automatically.

abort(self)

 

Aborts the solving and tuning methods.

Example usage:

>>> aborter = cplex.Aborter()
>>> aborter.abort()

clear(self)

 

Clears the invoking aborter.

Example usage:

>>> aborter = cplex.Aborter()
>>> aborter.clear()

is_aborted(self)

 

Returns True if the method to abort has been called.

Example usage:

>>> aborter = cplex.Aborter()
>>> aborter.is_aborted()
False

end(self)

 

Ends the invoking aborter.

Example usage:

>>> aborter = cplex.Aborter()
>>> aborter.end()

__enter__(self)

 

Enter the runtime context related to this object.

The with statement will bind this method's return value to the target specified in the as clause of the statement, if any.

Aborter objects return themselves.

__exit__(self, exc_type, exc_value, traceback)

 

Exit the runtime context.

When we exit the with block, the end() method is called.