help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Output to GMPL data file


From: Heinrich Schuchardt
Subject: Re: Output to GMPL data file
Date: Tue, 27 Jul 2021 20:32:28 +0200
User-agent: K-9 Mail for Android

Am 27. Juli 2021 20:06:53 MESZ schrieb Philippe Jugla 
<philippe.jugla@hotmail.fr>:
>Hello everyone,
>
>I am looping with a .bat file to run N simulations with glpsol.
>At the end of each simulation, I would like to use the value of a variable 
>which is calculated, as an input for the next simulation.
>What I have written in my .mod file doesn't work because it does not overwrite 
>my storage.dat file after each simulation...
>
>in the .mod file :
>TIME = 0..T-1;
>param initial_storage;
>var storage {t in TIME};
>/* I want to output the final storage value as initial storage for next 
>simulation*/
>printf ‘data; param initial_storage := ‘ & storage[T-1].val & ‘ ;’ >> 
>‘storage.dat’

Use a single > here.

>> is used to append.

Have a look at print format strings too.

Best regards

Heinrich

>printf ‘end ;’ >> ‘storage.dat’
>
>the .bat file :
>for /l %%k in (1,N,1) do (
>echo solving DAY %%k...
>"%GUSEKPATH%\glpsol.exe" --cuts -m "model.mod" -d "storage.dat" -d 
>"data_%%k.dat"
>)
>
>Is there a way of achieving this ?
>Thank you very much,
>
>Best regards,
>
>Philippe
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]