[英]C# Cplex setting parameters
我正在研究简单的优化问题。 我的模型正在运行,但是随着输入数量的增加,它花费了太多时间。 我使用CPLEX在C#中编写了代码。
所以,我想在MIPGAP = 0.5时停止它,但找不到方法。
当达到0.5个间隙时,我应该如何,在何处添加什么以及停止在我的代码上添加什么。
谢谢你提前。
以类似的方式设置间隙,在Param中具有TimeLimit
IloCplex solver(...); //initialise the solver with the model
... //many other commands
solver.setParam(IloCplex::Param::TimeLimit,timeout);//customised timeout
solver.setParam(IloCplex::EpGap,data.m_epgap); //uses customised epgap
if(!solver.solve()) {
//non found
return 0;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.