设置间隙公差和运行时间的限制 [英] Set limitation on gap tolerance and run time

查看:215
本文介绍了设置间隙公差和运行时间的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题:

  1. 在IBM ILOG CPLEX中,我编写了一个OPL项目.由于该代码可处理大规模数据,因此需要花费大量时间才能解决.限制MIP问题的间隙公差和限制时间的代码是什么?

  1. In IBM ILOG CPLEX, I wrote an OPL project. Because the code works with large scale data, it takes a lot of time to solve. What is the code for limitation the gap tolerance of MIP Problem and limitation the time?

我想要一个包含所需结果的CSV文件.例如,我想要在CSV文件中具有目标函数和运行时以及工具变量.我得到了所有这些结果,但我也希望将它们也写入CSV文件中.

I want to have a CSV file containing my desired results. For example, I want to have an objective function and runtime and the facility variable in a CSV file. I got all these results but I want them to be written in a CSV file too.

推荐答案

1)在.mod文件的minimize语句之前 之前添加以下代码.

1) Add the following code before the minimize statement in your .mod file.

execute
{
   cplex.tilim=30; // 20 s time limt
   cplex.epgap=0.01 // 1% gep
}

您可以通过检查引擎日志来确认已将其考虑在内.一开始应该有这样的东西:

You can confirm that it is taken into account by examining the engine log. It should have something like this at the very beginning:

CPXPARAM_TimeLimit                               30
CPXPARAM_MIP_Tolerances_MIPGap                   0.01

2)您可能依赖IloOplOutputFile

2) You may rely on IloOplOutputFile

请参见 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆