e-Constraint AUGMECON2 decision variables

Hello everyone,

i work with the e-constraint method. Now I want to get the decision variables for each solution for the optimal solutions calculated for the Pareto front (see comments in the code: * Here i would like to save the values of the decision variables and the objective value in an excel file) . Best for this would be a new created Excel file :slight_smile:

Where in the code do I have to make an adjustment?

The Model is attached:
Erweiterung.gms (9.99 KB)
You can also find the model here: https://www.gams.com/33/gamslib_ml/libhtml/gamslib_epscmmip.html?search=eps%20constraint

Many thanks in advance.

Hi Janisch
I would define parameters to collect the values of the variables in the loop. After the loop, you can send all the results to an excel file.

* Before the loop
parameter 
     results1(kp,k,*)   Results for variables over k
     results2(kp,*)   Results for scalar variables;
     
* After the solve
results2(kp, "objval") = a_objval.L;
...
results1(kp,k, "sl") = sl.L(k);

I hope this is what you are looking for.
CHeers
Renger

Hello Renger,

thanks for your answer. I have tried to adapt the code, but unfortunately I can’t manage to save the objective functions Z and the decision variables X (in case what to pack) per run of the model. The variables to be saved are defined in lines 83 and 84.

I also need to save the solutions in line 256.

I hope you can help me again :slight_smile:

I have attached the model.
Erweiterung.gms (10.2 KB)

Here you go
CHeers
Renger
Erweiterung.gms (10.2 KB)

Thanks Renger,

in the first loop the save now works. Thank you :slight_smile:

In the second loop (Line 263) I also want to save my solutions of the Paretofront. The number of solutions is variable, depending on the problem.
I tried to save the solutions in an array with a new set solu. But I do not know how to address the array correctly. I have already tried to get access to the first array dimension with the scalar iter. Unfortunately this did not work.

I hope you can help me with this problem again :slight_smile:

Many greetings
Jan
Erweiterung.gms (10.6 KB)

Hi Jan

Here a trick to do that:

* Ad the following to your code
parameter counter /0/;

repeat
   counter = counter + 1;
...

      results4(solu,k,"z")$(solu.val = counter) = Z.L(k);
      results3(solu,j, "X")$(solu.val = counter) = X.L(j););
...

Cheers
Renger

Hi Renger,

the trick was exactly what I was looking for!

Thank you! It works perfectly :slight_smile:

Greetings Jan