User Tools

Site Tools


Sending the model status to a GDX file

Q: I'm using GDX to read model results. I export the results of my models using the following command when I launch the model: gams model.gms gdx = out.gdx. All the information is there, except information on the status of the model. Is there any option to export the model status (normal completion, infeasibilities, etc.) to the GDX file once the model is completed?

Currently model attributes can not be stored directly in a gdx file. However you can save the model status plus some other model attributes in a parameter and write that parameter to a gdx file.

$call 'gamslib 1'
$include trnsport.gms
parameter modrep;
modrep('transport','solvestat') = transport.solvestat;
modrep('transport','modelstat') = transport.modelstat;
modrep('transport','resusd'   ) = transport.resusd;
modrep('transport','objval')    = transport.objval;
display modrep;
Execute_Unload "stat.gdx",modrep;             
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY interfaces/send_model_status_to_a_gdx_file.txt · Last modified: 2010/02/19 10:22 by support