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

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

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)

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

Tags

Asked:

on 11 Jul 2017

Answered:

on 11 Jul 2017

Community Treasure Hunt

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

Start Hunting!