Page 1 of 1

Creating multiple gx files using "option savepoint=2"

Posted: Thu Feb 11, 2021 4:08 pm
by before2
eoglsp_test.gms
(10.22 KiB) Downloaded 254 times
Hello,

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;

loop(SC_Fall,
    sc(k)=SCKosten(k,SC_Fall)
    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.

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

Posted: Fri Feb 12, 2021 8:04 am
by bussieck
The put_utility (https://www.gams.com/34/docs/UG_Put.html#UG_Put_PutUtil) should help you to create Excel files with names you specify. There are a couple of examples under the table.

Hope this helps,
-Michael