Is there a way to pause gamultiobj, run other computations/scripts and resume gamultiobj (with and without restarting MATLAB)?
1 回表示 (過去 30 日間)
古いコメントを表示
Operations with optimization tools consume days and weeks of time. My requirement is to pause such optimization, use MATLAB for other activities for some time, and then, resume the optimization. The other activities can include restarting MATLAB.
I have seen some answers, but those are just to pause and resume but not to do other computations in between.
At present, I am using gamultiobj and paretosearch and I can store the results after evaluation of every parameter set.
Thank you in advance.
0 件のコメント
回答 (1 件)
Walter Roberson
2024 年 12 月 3 日
First of all, create some globally accessible stop flag, such as in the base workspace.
Second of all, run gamultiobj with options that specify an output function, and requesting at least 5 outputs -- you need the 'population' output.
Have the output function check the global stop flag, and if the stop flag is set then change state.StopFlag to something non-empty.
Now run from the editor -- you need the Run / Pause feature.
At the appropriate time, click on the editor Pause button. Wait for it to pause. Now set the globally accessible stop flag to an appropriate value.
To resume, do the same thing again, except this time also specify the option InitialPopulationMatrix, specifying the 'population' output from before.
2 件のコメント
Walter Roberson
2024 年 12 月 5 日
You are right that OutputFcn runs at the end of a generation.
Hmmm....
You could have the objective function check the stop flag, and just return Inf if it is set. In theory gamultiobj should then reject those moves, holding on to the previous population members instead.
参考
カテゴリ
Help Center および File Exchange で Multiobjective Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!