Genetic Algorithm Initial Population Problem in Matlab
12 ビュー (過去 30 日間)
古いコメントを表示
How can I generate initial population of 50*11 in Matlab? The Upper and Lower limits are as under;
ub = [80 75 35 60 50 1.1 1.1 1.1 1.1 1.1 1.1];
lb = [20 0 10 0 0 0.95 0.95 0.95 0.95 0.95 0.95];
dim=11;
Population=50;
0 件のコメント
回答 (1 件)
Star Strider
2020 年 1 月 6 日
This is what I would do:
opts = optimoptions('ga', 'InitialPopulationMatrix',[randi([20 80], 50, 5) randi([95 110], 50, 6)*1E-2]);
The ga function does not need to know all the ranges, however it is (in my experience) usually better to begin with lower values than higher values, since ga more easily increases than decreases the individual elements in the population ‘genes’.
Include whatever other options you want. Then be sure to include ‘opts’ as the last argument to the ga call, remembering to fill all the intervening arguments with appropriate arguments or the empty matrix [].
4 件のコメント
Christopher Jarrett
2021 年 3 月 21 日
編集済み: Christopher Jarrett
2021 年 3 月 21 日
What if you needed to run the population of genes(variables) row by row threw a loop that did some calculation with the genes that generates another vector? How could you make it do that?
Walter Roberson
2021 年 3 月 21 日
You would probably code that through the selection function, mutation function, or crossover function.
参考
カテゴリ
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!