AMPL:在使用选项"timelimit"之后执行结果.为cplex满足所有约束? [英] AMPL: does the results after using the option "timelimit" for cplex meet all the constraints?

查看:438
本文介绍了AMPL:在使用选项"timelimit"之后执行结果.为cplex满足所有约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个虚拟的问题,我需要知道它的答案.我正在一个需要AMPL和CPLEX作为求解器的项目中.现在,此问题通常需要140秒钟以上才能解决.在搜索时,我遇到了一个名为timelimit的选项.我将此选项与值option cplex_options 'timelimit=5'一起使用,结果在5秒钟内显示出来.现在我的问题是,输出是否满足所有约束并且在代码中设置的边界之内?还是我只是终止了流程,结果是当前的正在处理"数据?感谢您的帮助.

I have a dummy question that I need to know its answer. I'm working on a project that requires AMPL and CPLEX as a solver. Now this problem normally takes more than 140 seconds to be solved. While I was searching, I came into an option called timelimit. I used this option with value option cplex_options 'timelimit=5'and the results were shown within 5 seconds. Now my questions is, does the output meet all the constraints and is within the boundaries I set in the code? Or did I just terminate the process and the results were the current "being processed" data? Thanks for helping.

推荐答案

如果未设置timelimit参数,则运行时间是在相对公差范围内获得可证明的最佳解决方案的时间(默认值为1e-6 ).通过设置时间限制,您告诉cplex在5秒钟后停止.在这种情况下,无论目标函数的质量如何,它都将返回找到的最佳解决方案.但是,cplex不会为您提供违反约束的解决方案.如果在分配的时间内找不到可行的解决方案,那么您将不会获得解决方案.您可以检查模型的exitcode后缀,以查看是否找到解决方案.

If you don't set the timelimit parameter, the run time is the time to get to a provably optimal solution within the relative tolerance (default is 1e-6). By setting a time limit, you are telling cplex to stop at 5 seconds. In that case, it will return the best solution it has found, regardless of the quality of the objective function. cplex will not, however, give you a solution that violates constraints. If it can't find a feasible solution in the time allotted, then you will not get a solution. You can check the exitcode suffix of the model to see if there was a solution found.

这篇关于AMPL:在使用选项"timelimit"之后执行结果.为cplex满足所有约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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