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

2 visualizaciones (últimos 30 días)
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 comentario
Geoff Hayes
Geoff Hayes el 11 de Jul. de 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...

Iniciar sesión para comentar.

Respuestas (1)

Sebastian Castro
Sebastian Castro el 11 de Jul. de 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

Categorías

Más información sobre 기초 수학 en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!