フィルターのクリア

How can I retrieve the value of the number of generations in Genetic algorithm??

1 回表示 (過去 30 日間)
sani ars
sani ars 2012 年 10 月 14 日
I have set the Generations = 10.
Now, I started the ga(). At first time, of course, the value of generations is 1. We call the Fitnessfunction in ga() i.e. ga(Fitnessfunction, nvar, myfit_func). I want to retrieve that "generation value 1" inside my Fitnessfunction. After Fitnessfunction executed, we will get the new population. At this time, the value of generation will become 2, now I have to use that value 2 inside my Fitnessfunction and so on up till 10
How can I do that?? I want to retrieve the value of generation for each iteration and have to use it in my Fitnessfunction. But ga() doesn't allow me to do that. I tried the "gen = Output .generation" inside the Fitnessfunction, but failed.

回答 (0 件)

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by