Calling GDX files Topic is solved

Problems with syntax of GAMS
Post Reply
edwardmw
User
User
Posts: 5
Joined: 1 year ago

Calling GDX files

Post by edwardmw »

Hello,

I have a master gms file that I run before calling one of several gms files, depending on the simulation I am running. I am calling all files in dos.

The master gms file is used to develop the baseline data. At the end of this master gms file I store the data in a file called baseline.gdx

I want to be able to load all sets, parameters, variables, etc in this baseline.gdx file when I run each simulation gms file.

It appears that to use the syntax $gdxin followed by $load, I need to specify each set and parameter and variable that I want to load. Is there not a way to load ALL elements from the gdx file?
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Calling GDX files

Post by bussieck »

No, there is no way to declare and load implicitly from a GDX file. That's what restart/work/save files (https://www.gams.com/latest/docs/UG_SaveRestart.html) are for. If you create a baseline save file then you can restart your simulation from there without redeclaring and loading symbols. If that does not work for you, you can create GAMS source file with all declaration and $load instruction by using the gdxdump (https://www.gams.com/latest/docs/T_GDXDUMP.html) utility: "gdxdump baseline.gdx nodata > baseline.gms". If the GDX file was created properly the declarations in the created GAMS source will have preserved all the domain information.

-Michael
edwardmw
User
User
Posts: 5
Joined: 1 year ago

Re: Calling GDX files

Post by edwardmw »

Thank you for this clear and helpful explanation!
Post Reply