Info

This question is closed. Reopen it to edit or answer.

How can I get an optimization algorithm (genetic algorithm in specific) to display the current best solution at each iteration?

1 view (last 30 days)
In gaoptimset, I set the display level 'display' to 'iter' and it prints the best value of the objective funtion at each iteration. But I would like to also see the best current solution (point) at each iteration. This is because sometimes the simulation takes so long that at a certain iteration, I need to stop the simulation and I would like to be able to access the best solution reached so far. Do you have any suggestions for me?

Answers (1)

Matt J
Matt J on 22 Sep 2014
Edited: Matt J on 22 Sep 2014
As I understood things, ga() will never throw away its best population member until a superior member is found. So the current population should always contain "the best".
In any case, you can capture anything you want with the OutputFcns option.

Community Treasure Hunt

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

Start Hunting!