首页 > 解决方案 > 在 .dat 文件中输入数据

问题描述

我正在解决一个多周期问题。有 6 个客户和 3 个期间。客户的需求在excel中写成如下:

Customer 1 Demand in period 1(B3)  Demand of period 2  Demand in period 3(D3)

Customer 6

我在 .dat 中写了如下内容: Dem from SheetRead(sheet,"Data!B3:D8"); 它给出了一个错误

标签: cplexopl

解决方案


.mod

range customers=1..6;
range periods=1..3;

int Dem[customers][periods]=...;

.dat

SheetConnection sheet("test.xlsx");

Dem from SheetRead(sheet,"Data!B3:D8");

工作正常。

你确定你有 excel 并且你有一台 Windows 机器吗?


推荐阅读