How can I obtain and view the automatic generated initial population from GA from Optimization Toolbox 5.1 (R2010b)?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I use the function GA without any given initial population and I want to view the initial population generated or produced by GA.
Respuesta aceptada
MathWorks Support Team
el 29 de Jun. de 2011
To see the intial population, one can specify or set the 'OutputFcns' property from the option used by GA. The function set by 'OutputFcns' gets called every itteration.
First write a function MATLAB file called my_view containing
function [state, options,optchanged] = my_view(options,state,flag,interval)
optchanged = false;
disp(state.Population)
end
Now set the 'OutputFcns' property to this function via
options = gaoptimset('OutputFcns',@my_view);
Finally call the GA function with this specified option
x = ga(fitnessfcn,nvars,options)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Design Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!