Print more iteration detail in GA code
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Maryam
el 31 de Oct. de 2018
Comentada: Alan Weiss
el 1 de Nov. de 2018
I have written a GA code, and I want to print out the variable's value at each iteration. Would you please let me know what command should I use for this matter? Thank you.
0 comentarios
Respuesta aceptada
Alan Weiss
el 1 de Nov. de 2018
Take a look at Custom Output Function for Genetic Algorithm. This enables you to get all population members at each iteration (if you modify the example just a bit).
Unless all you want is the best fitness function value at each iteration, in which case all you need to do is set the 'Display' option to 'iter'.
Alan Weiss
MATLAB mathematical toolbox documentation
2 comentarios
Alan Weiss
el 1 de Nov. de 2018
Again, I'm not sure that I understand exactly what you want. At each iteration there is a population. Perhaps what you want is the best individual at each iteration, the one that gives the lowest fitness function. In that case, look at the Custom Output Function example and just take bestx (which is a row vector containing the variables that I believe you want); you don't need the rest of the stuff for plotting and for saving the whole population.
Alan Weiss
MATLAB mathematical toolbox documentation
Más respuestas (0)
Ver también
Categorías
Más información sobre Solver Outputs and Iterative Display 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!