【发布时间】:2019-12-26 14:16:00
【问题描述】:
如何将 4D 数组从 Excel 表示和读取到 Opl Cplex? 3D IBM阵列链接没用,尝试适应4D也没用。
【问题讨论】:
如何将 4D 数组从 Excel 表示和读取到 Opl Cplex? 3D IBM阵列链接没用,尝试适应4D也没用。
【问题讨论】:
首先您可以使用 SheetRead 从 Excel 中读取元组集“输入”:
tuple t
{
string k;
string l;
string i;
string t;
float cost;
}
{t} input=...;
然后将这个元组集合转换成一个4D数组:
float cost[K][L][I][T];
execute
{
for(var x in input) cost[x.k][x.l][x.i][x.t]=x.cost;
}
注意:我在https://www.ibm.com/developerworks/community/forums/html/topic?id=bcaea400-c839-4f12-85bc-4750c48d68f3&ps=25处理过这个问题
【讨论】: