フィルターのクリア

How to use the population in the fitness function in GA

1 回表示 (過去 30 日間)
Sadegh Salesi Mousaabadi
Sadegh Salesi Mousaabadi 2019 年 3 月 15 日
編集済み: Sadegh Salesi Mousaabadi 2019 年 3 月 15 日
Hi,
I am writing a code for Multiobjective GA in which I need the evolved population in each iteration as an input for fitness fuction . The following is the code:
FitnessFunction = @Mobject;
numberOfVariables = 100;
opts = optimoptions('gamultiobj','PopulationType','bitString');
[sub,fval,output] = gamultiobj(FitnessFunction,numberOfVariables,[],[],[],[],[],[],opts);
And the fitness function is:
function f = Mobject(sub,pop)
do
.
.
.
.
end
As you can see the population has to be an input for calculating the fitness of each individual but I do not know how to do it. I tried to use output function but it apparenlty give the results when the solver has done the job.
Has anyone got any idea?
Thanks

回答 (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!

Translated by