After getting a respond at https://www.ibm.com/developerworks/community/forums/html/topic?id=dcdacecd-180a-4ce2-b70d-a178a9d4c1ac&ps=25, I decided to create an array while reading my data from a CSV file.
I define tuple and fill it.
tuple XTuple { string a; string c; int t; } setof(XTuple) Xtup ={ |in locset, t in 1..time };
Then, I define an array.
int arrayX[Xtup];
Now, when I read my data set, I need to identify each and start filling arrayX accordingly.
execute{ var f = new IloOplInputFile("X.csv"); while (!f.eof){ var str=f.readline(); var ar = str.split(","); if (ar.length==4) { myX[] = Opl.intValue(ar[3]); } } f.close(); }
Could you help me out how I should fill the inside of myX[] ?
Source: Creating an array thru scripting