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)
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
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)

Más respuestas (0)

Categorías

Más información sobre Simulink Design Optimization en Help Center y File Exchange.

Productos


Versión

R2010a

Community Treasure Hunt

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

Start Hunting!

Translated by