cplex - 在 .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");
它给出了一个错误
解决方案
.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 机器吗?
推荐阅读
- javascript - Loopback PeristentModel.findOne 返回 NaN 错误
- ruby - 当鼠标移到按钮上以突出显示它时,按钮周围应该有一个黑色边框
- java - Android:如何使用字符串“待定”检查从 MySQL 获取的 TextView 值?
- postgresql - 如何将新数据附加到 PostgreSQL 中的日志文件
- delphi - 如果另一端没有从套接字读取数据,如何避免在 Indy 中写入套接字时冻结
- python - vscode autopep8 不运行
- android - 应用程序因“isWhitelistProcess - 进程被列入白名单”而崩溃
- asp.net-core-webapi - ImageExtension 的汇编参考是什么
- java - 启动和中断并再次启动线程
- c# - 异常记录后无法单击“esc”键