Genetic Algorithm (ga) terminating after a few generations

I am running a minimization calculation using the ga function. I've noticed that the ga function continually terminates after ~3 generations. This seems to be premature; however, the results I am getting are consistent. I have 6 design variables and a population of 1000 that is evenly gridded across reasonable values for each variable. In total the ga usually calls the objective function 10^5 times before terminating and meets the function and constraint tolerances (both 10^-6). I am curious to know if terminating after 3 generations is a "normal" behavior or if this indicates a problem with my objective function. Any help is greatly appreciated.

 採用された回答

Star Strider
Star Strider 2023 年 8 月 15 日

0 投票

That is certainly consistent if it converges quickly, and especially if it produces a reasonable result. If your 'InitialPopulationMatrix' is (1000x6) then it is quite possible that it finds a good fit in 3 generations. (I generally use smaller matrices.)

4 件のコメント

agion
agion 2023 年 8 月 15 日
That is what I was thinking. I've tried to reduce the number of the initial population to ~200 and the solver behaves the same, retruing a result in 3 generations with similar function counts.
Star Strider
Star Strider 2023 年 8 月 15 日
That works. Your problem must be relatively straightforward.
You can ‘fine-tune’ the results using a hybrid function (see: ga Hybrid Function) if you so choose.
agion
agion 2023 年 8 月 15 日
Thank you for the information. I will take a look at those options.
Star Strider
Star Strider 2023 年 8 月 15 日
As always, my pleasure!

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

その他の回答 (1 件)

Alan Weiss
Alan Weiss 2023 年 8 月 16 日

0 投票

Almost certainly this is because you use nonlinear constraints. When you use nonlinear constraints, there are very few major iterations in the solver. For an example, see https://www.mathworks.com/help/gads/constrained-minimization-using-ga.html.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

製品

リリース

R2022b

質問済み:

2023 年 8 月 15 日

回答済み:

2023 年 8 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by