简体   繁体   English

如何在 Excel 中的 Opl Cplex 中表示和读取 4D 数组

[英]How to represent and read 4D array in Opl Cplex from Excel

How can I represent and read a 4D array from Excel to Opl Cplex?如何从 Excel 到 Opl Cplex 表示和读取 4D 数组? The 3D IBM array link is not helpful, trying to adapt to 4D does not work. 3D IBM 阵列链接没有帮助,尝试适应 4D 不起作用。

First you can use SheetRead to read a tuple set "input" from Excel:首先,您可以使用 SheetRead 从 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:然后将此元组集转换为 4D 数组:

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注意:我在https://www.ibm.com/developerworks/community/forums/html/topic?id=bcaea400-c839-4f12-85bc-4750c48d68f3&ps=25处理了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM