Info

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

Genetic algorithm' s options

2 views (last 30 days)
Luca Riccardi
Luca Riccardi on 26 Apr 2019
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi all,
I think to have a problem with the options for the ga solver. I set these options:
options = optimoptions('ga','MaxGenerations',1000,'PlotFcn',@gaplotbestf);
I believe that the solver ignores these options, do you know where the problem may be?
  9 Comments
Star Strider
Star Strider on 26 Apr 2019
I don’t know the default number of generations between the 'PlotFcn' calls, since that value is not documented and it isn’t possibly to query it. See if adding:
'PlotInterval',1
to your optimoptions argument list helps. That will plot after each generation.
Luca Riccardi
Luca Riccardi on 26 Apr 2019
Nothing happens, but I guess that the problem is in the fitness function, since, trying with another one, it works correctly. Maybe it is too slow and so more than 1000 generations are required for converging.

Answers (0)

Tags

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!