How to: Respond to the Solving Event from a Solver
You can subscribe to the solving event that is raised by a solver and respond to the event. The following procedure demonstrates how to add a solving event and cancel the solve process after the absolute gap between the primal and dual objectives of interior point method solver is acceptable.
To respond to the solving event
Create a C# Solver Foundation Console Application.
Add the following using statement to the top of the Program code file.
Add the following statement to the try statement to subscribe to the solving event.
Add the following code that checks the absolute gap between the primal and dual objectives of the interior point method solver. If the absolute gap is acceptable, the solver can stop the solve process.