필터 지우기
필터 지우기

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

조회 수: 1 (최근 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개)

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by