c# - 如何检查.NET中用CPLEX编码的模型是否是真实模型?

标签 c# .net mathematical-optimization linear-programming cplex

我使用 C# 在 CPLEX 中编写了一个 MIP。我声明了变量和约束并添加了目标,但我无法得到正确的答案。有没有办法将模型打印到字符串变量或类似的东西中,以检查我是否正确编码了我想要的模型?

最佳答案

您可以尝试将其导出为人类可读的 CPLEX LP 格式。

我既不使用 CPLEX 也不使用 .NET,但是根据 this website您正在寻找的功能是:

LOG CPLEX .NET Reference Manual Cplex.ExportModel Method

Writes the active model to the file specified by filename.

public virtual void ExportModel( String name );

Parameters

name
The name of the file to which the model is written. The extension of the filename determines the format in which to write the model file.

Remarks

The file format is determined by the extension of the filename. The following extensions are recognized on most platforms:

.sav
.mps
.Lp
[...]

希望这对您有所帮助。

关于c# - 如何检查.NET中用CPLEX编码的模型是否是真实模型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23447636/

相关文章:

c# - 数字和空格 - 松散的电话正则表达式

c# - 在 Protocol Buffers 中表示 System.Decimal 的最佳方式是什么?

python - CVXOPT 输出抑制与 MOSEK

python - 使用 SCIPY.OPTIMIZE.FMIN_CG 提取威 bool 分布参数

c# - Windows Phone 7.5 横向模式下不显示自动完成框弹出窗口

c# - WP7 Json 序列化器不处理 "space"?

c# - mac 上单声道的 pkg-config 路径

c# - SoapHttpClientProtocol/HttpWebClientProtocol 连接状态

.net - 如何说服sql server 2008r2使用clr v4.0而不是v2.0?

python - 在 PuLP(Python) 中指定 lowBound 和 upBound