How can I retrieve the value of the number of generations in Genetic algorithm??
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!