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

2 views (last 30 days)
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 Comment
Geoff Hayes
Geoff Hayes on 11 Jul 2017
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...

Sign in to comment.

Answers (1)

Sebastian Castro
Sebastian Castro on 11 Jul 2017
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

Categories

Find more on 기초 수학 in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!