1

I already read the other Topics About writing multidimensional Arrays from CPLEX to Excel, and tried the solution provided, but it did not work.

In my case I have a 4-dimensional variable. So I build a 5-dimensional tuple and want it to be written in Excel. Running CPLEX, I get the error message "The element "Ausgabe" is not defined" and "the index for array "y#0 is out of range: 5". How can I fix the Problem?

.mod
 int nbSzenarien = ...;
 int nbStandorte = ...;
 int nbKunden = ...;
 int nbProdukte = ...;

 range S = 1..nbSzenarien;
 range J = 1..nbStandorte;
 range I = 1..nbKunden;
 range K = 1..nbProdukte;

 dvar float+ y[S][J][I][K];


tuple Verteilung {
 int S; 
 int J; 
 int I; 
 int K; 
 float value;};

{Verteilung} Ausgabe ={<s,i,j,k, y[s,i,j,k]>|s in S, i in I, j in J, k in K};

Thank you!

LSM_3008
  • 11
  • 1
  • Please post the full .mod and .dat files (or at least a minimal example for your problem). Since the errors may depend on the places in which you define things, we cannot help without seeing the full thing. – Daniel Junglas Oct 25 '19 at 17:15

1 Answers1

1

Make sure that the definition of Ausgabe is after the the subject to block.

Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22