我目前正在使用这些Ilog Cplex
库在 java 中开发一个项目,我正在使用 Intellij-Idea IDE。我在从MPS
文件中导入模型时遇到问题,这是给我带来问题的一段代码
IloCplex iloCplexInstance = new IloCplex();
iloCplexInstance.importModel(fileName);
它触发此异常:
ilog.cplex.CpxException: CPLEX Error 1423: Could not open file 'models\20_70_45_05_100.mps' for reading.
at ilog.cplex.CplexI.CALL(CplexI.java:5204)
at ilog.cplex.CplexI._readModel(CplexI.java:5584)
at ilog.cplex.CplexI.importModel(CplexI.java:1032)
at ilog.cplex.IloCplex.importModel(IloCplex.java:902)
at heuristics.ziround.LPUtils.fromMPS(LPUtils.java:34)
at heuristics.test.LPUtilsTestCompile.main(LPUtilsTestCompile.java:13)
我尝试在单元测试中使用junit4
,junit.runners.Parameterized
和在其主要方法中的一个简单类中运行它。每种情况下的结果相同。我也尝试设置文件的完整路径,它给出了相同的结果。我知道我使用的文件没问题,我可以使用 cplex 终端命令读取它,我也尝试了其他文件。
使用Ilog
's 库的代码可以编译,但我不确定它是否可以运行,因为我无法导入我无法尝试解决的模型。
我正在使用 Windows,以管理员身份启动 IDE 没有任何影响,并且文件未被阻止读取(或写入)。
在官方支持页面中,我发现了这个错误:http ://www-eio.upc.es/lceio/manuals/cplex-11/html/refcallablelibrary/html/macros/CPXERR_FAIL_OPEN_READ.html
但我找不到任何有用的东西。
此外,IBM 论坛目前已关闭,似乎没有人遇到过这种问题 :(
有谁知道可能是什么问题?我能做些什么?你知道还有其他选择吗?
感谢任何会停下来的人!