Genetic Algorithm Iteration display in command window real time
Mostrar comentarios más antiguos
I was reading the thread http://www.mathworks.com/matlabcentral/answers/180145-saving-showing-value-of-variables-in-genetic-algorithms and had a similar question. I wanted to know whether there is any was to display the best score and the population corresponding to that best score after every generation in the command window while matlab is running the code. Is that possible ?
Respuesta aceptada
Más respuestas (1)
Marcos Rogério Fernandes
el 30 de Nov. de 2018
Editada: Marcos Rogério Fernandes
el 30 de Nov. de 2018
You can use the "gaoptimset" function to define the parameter "Display" as 'iter', so the command you should use is
[x,fval]=ga(@fitness,nVal,[],[],[],[],[],[],[],gaoptimset("Display","iter"))
So in that way, while matlab is running the ga algoritm it will show in the command window informations about each generation.
Categorías
Más información sobre Genetic Algorithm en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!