Infeasibility as a variable

Hello all!

I want to create a variable in GAMS that returns the feasibility of the solution. For example, say the variable is ‘b’, and once the solution is completed, I want b=1 if the solution is feasible, and b=0 if infeasible. Is there any way to do that?

Thanks in advance!

Hi
You can save the solve status in a parameter.

b = mymodel.solvestat;

Have a look at the solvestat possible values here.

Cheers
Renger

Awesome, thank you Renger!