GAMS .NET API - Tutorial and Examples
This example demonstrates how to implement a complex termination criterion for a difficult MIP using GAMS/Cplex. More...
This example demonstrates how to implement a complex termination criterion for a difficult MIP using GAMS/Cplex.
We would like to achieve a globally optimal solution (relative gap 0%) but if solution time becomes larger than n1 seconds, we can compromise for a 10% gap, and if this is not achieved after n2 seconds, we compromise for a 20% gap, and again if this is not accomplished in n3 seconds we take whatever the solver has done so far and terminate the solve. This is implemented by executing GAMSJob.run in an independent thread and providing new tolerances for the relative gap in the main thread by supplying new GAMS/Cplex option files and triggers the processing of the new tolerance option by GAMS/Cplex through the GAMSJob.Interrupt method.