GA(遺伝的アルゴリ​ズム)での各世代での​目的関数の値を知りた​い

2 ビュー (過去 30 日間)
fumito ito
fumito ito 2017 年 8 月 24 日
コメント済み: fumito ito 2017 年 8 月 25 日
現在遺伝的アルゴリズムによる目的関数の最小化を行っています.
[X,Y]=ga(@M02_FitnessFunction,30,A,b,Aeq,beq,lb,ub,nonliner,options)
上記に示すようにGAを実行していますが,この場合だと最終的な目的関数の値(Y)と, その時の変数(X)しか出力されません. 収束されているかどうかの確認のためにも各世代の目的関数を知りたいのですが出力させる方法はありませんか. ちなみに世代数は50にしてあります. 宜しくお願いします.

採用された回答

Tohru Kikawada
Tohru Kikawada 2017 年 8 月 24 日
目的関数の値を各反復ごとにプロットしたいということであれば gaoptimset を使って PlotFcn @gaplotscores などに設定してみてください。
  3 件のコメント
fumito ito
fumito ito 2017 年 8 月 25 日
options=gaoptimset('PlotFcn','@gaplotscores)
こういうことでよろしいでしょうか.
fumito ito
fumito ito 2017 年 8 月 25 日
イメージとしては横軸世代,縦軸目的関数の値(最も良い値)でグラフをつくりたいです.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!