Page 1 of 1

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

Posted: Sat Apr 14, 2018 6:09 am
by moosavi_69
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.

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

Posted: Sun Apr 15, 2018 2:01 pm
by moosavi_69
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