Genetic Algorithm Initial Population Problem in Matlab

12 ビュー (過去 30 日間)
Inam Khan
Inam Khan 2020 年 1 月 6 日
コメント済み: Walter Roberson 2021 年 3 月 21 日
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;

回答 (1 件)

Star Strider
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
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
Walter Roberson 2021 年 3 月 21 日
You would probably code that through the selection function, mutation function, or crossover function.

サインインしてコメントする。

カテゴリ

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