Infeasibility as a variable

Problems with syntax of GAMS
Post Reply
cnbrksnr
User
User
Posts: 13
Joined: 4 years ago

Infeasibility as a variable

Post by cnbrksnr »

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!
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Infeasibility as a variable

Post by Renger »

Hi
You can save the solve status in a parameter.

Code: Select all

b = mymodel.solvestat;
Have a look at the solvestat possible values here.

Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
cnbrksnr
User
User
Posts: 13
Joined: 4 years ago

Re: Infeasibility as a variable

Post by cnbrksnr »

Renger wrote: 3 years ago Hi
You can save the solve status in a parameter.

Code: Select all

b = mymodel.solvestat;
Have a look at the solvestat possible values here.

Cheers
Renger
Awesome, thank you Renger!
Post Reply