How to set the population same as the initial population in GA toolbox?

2 次查看(过去 30 天)
I want to give the population using the customized algorithm when i use the GA toolbox.
I know how to specify the initial population, so i want to know how to set the population same as the initial population
Thank you!
  1 个评论
Geoff Hayes
Geoff Hayes 2017-7-11
YeonSoo - please clarify what population you want to set. The GA will update the initial population on the first interation/generation of the algorithm and then continue to update that modified population for every iteration thereafter...

请先登录,再进行评论。

回答(1 个)

Sebastian Castro
Sebastian Castro 2017-7-11
You can set this up with optimoptions... namely, the InitialPopulationMatrix field of that structure. For example, if you want 5 of the initial population to have a certain value x0:
opts = optimoptions('ga');
opts.InitialPopulationMatrix = repmat(x0,[5 1]); % Add copies of initial value
x = ga(costFcn,N,[],[],[],[],[],[],[],[],opts);
- Sebastian

类别

Help CenterFile Exchange 中查找有关 기초 수학 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!