【问题标题】:How to represent and read 4D array in Opl Cplex from Excel如何在 Excel 中的 Opl Cplex 中表示和读取 4D 数组
【发布时间】:2019-12-26 14:16:00
【问题描述】:

如何将 4D 数组从 Excel 表示和读取到 Opl Cplex? 3D IBM阵列链接没用,尝试适应4D也没用。

【问题讨论】:

    标签: arrays excel cplex opl 4d


    【解决方案1】:

    首先您可以使用 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处理过这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 2020-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      相关资源
      最近更新 更多