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
Where in the code do I have to make an adjustment?
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
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.
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.