How can I report and store the optimality status of solutions in the GAMS (in gdx files)?

Problems with syntax of GAMS
Post Reply
moosavi_69
User
User
Posts: 16
Joined: 2 years ago

How can I report and store the optimality status of solutions in the GAMS (in gdx files)?

Post by moosavi_69 » 1 year ago

Dear sir/ madam,

I have coded a problem and used Cplex as the solver. I want to store the optimality status of solutions of this problem. To be more precise, I want to store them in gdx files. Although the GAMS indicates this issue on its report page (i.e., Absolute Gap), I could not find a way to record and store this value. For more clarification, I have uploaded a picture in the following link.

http://uupload.ir/files/ady8_untitled.png


I have to thank you for the privilege of your time and thank you very much for your help.

moosavi_69
User
User
Posts: 16
Joined: 2 years ago

Re: How can I report and store the optimality status of solutions in the GAMS (in gdx files)?

Post by moosavi_69 » 1 year ago

I found the answer to this question. After solving a model, it saves its features in its attributes. For further details, interested readers can see the following link:
https://www.gams.com/latest/docs/UG_Mod ... Attributes

For instance, if we want to optimize a model entitled "Final", we'll have:
...
Solve Final using MIP min Z;
Scalar Status;
Acronym Optimal, NotOptimal;
Status=Final.solveStat;
if(Status=1,
Status=Optimal;
else
Status=NotOptimal;
);
Hope that helps

Post Reply