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
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
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
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!