I'm using one of the implementations of the epsilon-constrained method to find some of the solutions in the Pareto front. However, I would like to store the results and some post-processed parameters into separate excel files. Most of these solutions are obtained in loops and, therefore, I would like to use the values of the sets being looped to name each excel file.
$Set Instance CraggyTerrain
loop(kp,
kk(kp)=yes;
repeat
solve mod_payoff using mip maximizing obj;
payoff(kp,kk) = z.l(kk);
z.fx(kk) = z.l(kk);
*// freeze the value of the last objective optimized
kk(f++1) = kk(f);
*******************************Mipstart_ Give an intial solution
x.l(i,j,k)=x.l(i,j,k);
b.l(i,k)=b.l(i,k);
y.l(i,j)=y.l(i,j);
execute_unload "Results_payoff%Instance%_%FirstOF(kp)%_%SecondOF(kk)%.gdx" z.l x.L y.L b.L;
execute 'GDXXRW.EXE Results_payoff%Instance%_%FirstOF(kp)%_%SecondOF(kk)%.gdx var=x.l rng=x!b2'
execute 'GDXXRW.EXE Results_payoff%Instance%_%FirstOF(kp)%_%SecondOF(kk)% var=y.L rng=y!b2'
execute 'GDXXRW.EXE Results_payoff%Instance%_%FirstOF(kp)%_%SecondOF(kk)% var=b.L rng=b!b2'
until kk(kp); kk(kp) = no;
* release the fixed values of the objective functions for the new iteration
z.up(f) = inf; z.lo(f) =-inf;
);
For the %Instance% part I can simply declare a local variable like $Set Instance CraggyTerrain
but I can't seem to find a way to use these variables (local, global, environment) to build the rest of the file name, generating a different excel file for each solution.
Is there a way to update local variables with the parameters, set or variables from the model within a loop/repeat statement?
Thank you in advance, Raquel Aguiar.