admin管理员组文章数量:1356285
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
1 Answer
Reset to default 0If 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.
本文标签:
版权声明:本文标题:How can I write the values of a decision variable to an Excel sheet after running an iterative optimization in CPLEX OPL? - Stac 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744041927a2580820.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论