Recording the Relative gap

Problems with syntax of GAMS
Post Reply
waeltaha
User
User
Posts: 6
Joined: 3 years ago

Recording the Relative gap

Post by waeltaha »

hello
I need to record the relative gap in a parameter in order to write it in an excel file.
In the lst file, I get the relative gap as 0.0018, for example. Since I run large number of models, I need to record the relative gap for each model in an excel file automatically at the end of running each model. The problem is how to automatically get or extract the relative gap to store it in a parameter?
I have tried the following after the solve statement

parameter rgap;
rgap=model_name.optcr;

after writing the rgap into an excel file, I found that its value is NA instead of 0.0018.
How to solve this issue?
I'm using gams 24.5.3.

Thanks for help
Post Reply