Regarding Genetic Algorithm Optimization- How to stop GA tool after each generation

4 ビュー (過去 30 日間)
Mohamed
Mohamed 2014 年 5 月 25 日
コメント済み: Luuk VK 2017 年 6 月 5 日
Hello,
I am using GA as optimization tool for my work. I am exchanging data between MATLAB & other software called gPROMS. There is a link between the two softwares so, I am not asking how link them. I would like to use GA to optimize an objective function in gPROMS but I need to stop GA after each generation to send the result to gPROMS then get new inputs back to GA. Is there a way to stop GA after each generation knowing that I don't want to write the GA code but I need to use GAtool.
Thanks in advance
  1 件のコメント
Luuk VK
Luuk VK 2017 年 6 月 5 日
Hello Mohamed,
I am trying to link MATLAB and gPROMS as well for the use of GA, have you succeeded in coupling the programmes and running the algorithm effectively?

サインインしてコメントする。

回答 (2 件)

George Papazafeiropoulos
George Papazafeiropoulos 2014 年 5 月 25 日
t=0.2; % or any other reasonable time value
while exist('filename.extension','file')==2
pause(t)
end
  2 件のコメント
Mohamed
Mohamed 2014 年 5 月 25 日
Thanks a million. As I understand, this will stop the operation of GA after certain time interval. However, I can't control the number of iterations per unit time as it depends on many factors such as the pc processor for example. If you can help me with stopping gatool after each generation, I will be grateful. Thanks for your help and all your advices are welcome
George Papazafeiropoulos
George Papazafeiropoulos 2014 年 5 月 25 日
The file named 'filename.extension' will be a file that is created during the analysis of gPROMS and is supposed to stay there till the analysis is completed. If this file exists, MATLAB goes into the while loop and pauses. As soon as the analysis of gPROMS finishes, the above file is erased automatically by gPROMS, the while loop is not executed, and MATLAB proceeds to further execution. Of course, for the above to be applied, gPROMS must generate a file named 'filename.extension', the existence of which will show that gPROMS is running

サインインしてコメントする。


Mohamed
Mohamed 2014 年 5 月 25 日
Thank for your help. I will try your solution then let you know how it works. Thanks again

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by