Creating multiple gx files using "option savepoint=2"

questions about GAMS' tools
Post Reply
Posts: 3
Joined: 1 year ago

Creating multiple gx files using "option savepoint=2"

Post by before2 » 8 months ago

(10.22 KiB) Downloaded 82 times

for a Lot sizing model I'd like to run multiple test instances and have the solution and some parameters of the test instances saved in different excel files.
My attempt was to run a loop and let it solve the different cases like this:

Code: Select all

model EOGLSP_test /All /;

option savepoint=2;

    solve EOGLSP_test minimizing ZF using MIP;
    execute_unload sc
In the future I want to add more test instances resulting in more loops. So I'd like the files to be created automatically for every test instance.
I added the complete code to my post as well.

It has worked so far that two different gdx files are generated. In this case EOGLSP_test_p1 and EOGLSP_test_p2.
But I'd like to also add parameters. For example the setup costs sc(k) to the gdx file. I tried doing this with the command "execute unload".
Is this the right approach? I tried some different things and read through the Gams Data Exchange documentation. But unfortunately I'm not making much progress.

The next step after that would be to create an excel file for every test instance as well with parameters and variables that are of interest to me.

Thanks for taking the time to read my post and I'm thankful for any help in advance.
I hope I didn't forget any crucial information. If I did please let me know.

User avatar
Posts: 645
Joined: 5 years ago

Re: Creating multiple gx files using "option savepoint=2"

Post by bussieck » 8 months ago

The put_utility ( should help you to create Excel files with names you specify. There are a couple of examples under the table.

Hope this helps,

Post Reply