最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I write the values of a decision variable to an Excel sheet after running an iterative optimization in CPLEX OPL? - Stac

programmeradmin1浏览0评论

I am performing an iterative optimization using the main function in CPLEX OPL. After each iteration, I want to write the values of the decision variables to an Excel sheet. The optimization runs for 100 iterations, and the variable x has a size of 100×96 (i.e., x[1..100][1..96]). While I am writing the variable values to an Excel sheet, I noticed that the values from the last iteration are not being saved. Currently, I am using a .dat file for this process. How can I ensure the values from all iterations, including the final one, are correctly written to Excel?

I am performing an iterative optimization using the main function in CPLEX OPL. After each iteration, I want to write the values of the decision variables to an Excel sheet. The optimization runs for 100 iterations, and the variable x has a size of 100×96 (i.e., x[1..100][1..96]). While I am writing the variable values to an Excel sheet, I noticed that the values from the last iteration are not being saved. Currently, I am using a .dat file for this process. How can I ensure the values from all iterations, including the final one, are correctly written to Excel?

Share Improve this question asked Mar 28 at 11:02 SUBHADARSHINI PANDASUBHADARSHINI PANDA 233 bronze badges 1
  • Please include an minimal reproducible example to help readers to answer your question. – Black cat Commented Mar 28 at 11:14
Add a comment  | 

1 Answer 1

Reset to default 0

If the values from the last iteration are not saved and the previous ones are, and if you use SheetWrite to write results into excel, then in your main loop you should check that you call postProcess for the last iteration.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论