简体   繁体   English

将 CPLEX 结果链接到另一个 CPLEX 程序

[英]Linking CPLEX result to another CPLEX program

I'm working on an optimization problem at the moment and I'm trying to use the results I receive from the VRPTW for a bin packing problem.我目前正在处理一个优化问题,我正在尝试使用从 VRPTW 收到的结果来解决装箱问题。 Does anyone now how to automatise that?有没有人现在如何自动化? Right now I'm typing in the results manually.现在我正在手动输入结果。

Thanks for helping a newbie:)感谢您帮助新手:)

If you write your code in a programming language (C, C++, Java, Python, ...) then you can get the solution vector from CPLEX and directly feed it into the part of the code that creates the second model.如果您使用编程语言(C、C++、Java、Python 等)编写代码,那么您可以从 CPLEX 获取解向量并将其直接提供给创建第二个模型的代码部分。

If you instead solve on the command line or in different processes you can export the solution to a file and read that file from the code that creates the model.如果您改为在命令行或在不同进程中求解,则可以将求解导出到文件并从创建模型的代码中读取该文件。 CPLEX has functions to write and read solution files. CPLEX 具有写入和读取解决方案文件的功能。

Finally, if you are writing in OPL then you could write your models to a text file (using IloOplOutputFile ) in .dat format and use that file as input for the second model.最后,如果您使用 OPL 进行编写,那么您可以将模型写入.dat格式的文本文件(使用IloOplOutputFile ),并将该文件用作第二个模型的输入。 Or use the solution from the first model as starting point for the second model as described in the example warmstart that is shipped with CPLEX.或者使用从所述第一模型的溶液,作为如实施例中所述起点为第二模型warmstart该附带CPLEX。

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

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