How can I represent and read a 4D array from Excel to Opl Cplex? The 3D IBM array link is not helpful, trying to adapt to 4D does not work.
First you can use SheetRead to read a tuple set "input" from Excel:
tuple t
{
string k;
string l;
string i;
string t;
float cost;
}
{t} input=...;
and then convert this tuple set into a 4D array:
float cost[K][L][I][T];
execute
{
for(var x in input) cost[x.k][x.l][x.i][x.t]=x.cost;
}
NB: I dealt with this at https://www.ibm.com/developerworks/community/forums/html/topic?id=bcaea400-c839-4f12-85bc-4750c48d68f3&ps=25
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.