【问题标题】:IBM CPLEX Ilog Error : "Excel size of range is not the size of the array"IBM CPLEX Ilog 错误:“范围的 Excel 大小不是数组的大小”
【发布时间】:2018-11-03 23:04:10
【问题描述】:

我正在连接到 Excel 以解决问题。我曾使用相同的 .mod 文件来解决 27 行 excel 数据的问题。现在我正在尝试使用 366 行数据的 excel。对于其中一个数据(值),我收到一个错误“Excel 范围的大小不是数组的大小”,而像块这样的其他数据都可以。我看不出这是什么原因。谁能告诉我可能是什么原因造成的。 dat 文件如下:

SheetConnection sheet("Pit113_Reserves_by_block.xlsx");

BlocksType from SheetRead(sheet,"Data!A2:D367");
Blocks from SheetRead(sheet,"Data!A2:A367");
TimePeriods from SheetRead(sheet,"Data!O2:O6");

value from SheetRead(sheet,"Data!H2:H367");
oreTons from SheetRead(sheet,"Data!F2:F367");
wasteTons from SheetRead(sheet,"Data!G2:G367");

resourceMaxCap from SheetRead(sheet,"Data!P2:P6");
processMinCap from SheetRead(sheet,"Data!Q2:Q6");

schedule to SheetWrite(sheet,"Data!I2:M367");

mod文件声明部分如下:

    {int} TimePeriods =...;

{int} Blocks =...;



float value[Blocks] = ...;
float oreTons[Blocks] = ...;
float wasteTons[Blocks] = ...;
float resourceMaxCap[TimePeriods] =...;
float processMinCap[TimePeriods] =...;

【问题讨论】:

    标签: arrays size cplex ilog


    【解决方案1】:

    谢谢。我弄清楚了这个问题。我使用的 Blocks 值不是连续的序列号。我使用了一些逻辑来根据块的位置通过不连续的数字来识别块。我把它改成了一个连续的数字,它现在可以工作了。感谢您对此进行调查。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-09
      • 1970-01-01
      • 2020-10-30
      • 2014-11-14
      相关资源
      最近更新 更多