I have been trying to write a 3D decision variable from C-plex to Excel. My problem is that when I convert the decisional variable array into a tuple to write the values into an excel file, the values are always written in one singular column (In my example below the actual values are written into 180 rows(15x2x6=180) and four columns meaning a 180 x 4 matrix.
I would like to restructure the format in which the values are written into the excel file. Meaning, I would like to restructure in a way where I can get a 15 X 12 matrix (k = 15 rows and LxT=2x6=12 columns).
Is this possible to achieve in C-plex ?
My code is as following:
.
.mod:
int K = 15;
int L = 2;
int T = 6;
range k = 1..K;
range l = 1..L;
range t = 1..T;
dvar X[k][l][t];
subject to {
...
}
tuple sample{
int K;
int L;
int T;
int value;
};
{sample} example = {<K,L,T,X[K,L,T]> | K in k, L in l, T in t};
.dat:
SheetConnection Test ("Thesis.xlsx");
example to SheetWrite(Test,"Output!C2:F181");
Thank You!