仅构建和检查模型

Only build and check model

我在 ILOG CPLEX 中有一个用 OPL 编写的模型。我想 运行 所有语义检查(特别是所有 assert 语句)。我不想生成任何输出文件或求解模型。

根据 doc 中解释的执行过程摘要判断,我只想执行阶段 1-3。

有没有办法从 IDE 做到这一点?或者它是否需要 *.ops 文件或在主块中使用 OPL 脚本编写脚本?

在文档中,您应该查看浏览范围

IDE 和 OPL > CPLEX Studio IDE > IDE 参考 > 图形用户界面 > 菜单命令和等效的工具栏按钮

此操作在 IDE 中可用及其作用:

"Builds or rebuilds the model tree of the data structures defined in the active model or project to allow browsing the project in the Problem browser without solving it.

You can click the arrow next to the button and select the file to browse from the contextual menu."

如果您更喜欢使用流控制和脚本,并且您的模型只是预处理、约束和后处理,您可以添加

main
{
  thisOplModel.generate();
  writeln("ok");
}

不会调用 solve