How can I retrieve the value of the number of generations in Genetic algorithm??
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!