简体   繁体   English

我的 cplex 脚本不能在没有错误的情况下在 python 上运行

[英]My cplex script does not work on python with no error

I have been using Cplex and docplex (on python) on my PC for a long time and it was working fine.我已经在我的 PC 上使用 Cplex 和 docplex(在 python 上)很长时间了,它运行良好。 But lately when I run my script it starts the engine but it sticks at the beginning for a very long time (24 hours maybe) and then it terminates the process with no solutions and no error.但是最近,当我运行我的脚本时,它会启动引擎,但它会在开始时停留很长时间(可能是 24 小时),然后它在没有解决方案也没有错误的情况下终止了进程。 When I use conflict_refiner same thing happens, it sticks on checking conflicts, it does not finish checking conflicts and it does not return any conflicts.当我使用 conflict_refiner 发生同样的事情时,它坚持检查冲突,它没有完成检查冲突,也不会返回任何冲突。 I tested my script on other device and it was working fine.我在其他设备上测试了我的脚本,它运行良好。 I can not understand the problem.我不明白这个问题。 Here are my device info:这是我的设备信息:

Windows: 10
python (anaconda): 3.6.9
Spyder: 3.6
Cplex studio: 12.10.0
docplex :2.15.194

Edit: Current model log_output freezes here:编辑:当前模型 log_output 在这里冻结:

       Nodes                                         Cuts/
   Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap

      0     0        0.0000 72605                      0.0000        7         

So, you are saying that your Python program started behaving differently, all things being equal?所以,你是说你的 Python 程序开始表现不同,所有事情都是平等的?

It is not possible to answer without knowing what exactly is your program doing?如果不知道您的程序究竟在做什么,就无法回答? It is solving a model?是求解模型吗? If so did you turn on logging by passing log_output=True , if this is the case, does the log differ?如果是这样,您是否通过传递log_output=True打开日志记录,如果是这种情况,日志是否有所不同?

If your problem has no solution, the conflict refiner may sometimes take very long time.如果您的问题没有解决方案,冲突优化器有时可能需要很长时间。 I suggest you try the docplex.mp.Relaxer class, which implements a relaxation algorithm.我建议你试试docplex.mp.Relaxer类,它实现了一个松弛算法。 It usually runs faster, but does not answer the same question.它通常运行得更快,但不回答相同的问题。 Relaxer tries to minimize slack to make the problem feasible, and shows you which constraints had to be relaxed, and by how much slack. Relaxer 尝试最小化松弛以使问题可行,并向您显示必须放松哪些约束以及松弛程度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM