Genetic algorithm, nonlinear constraints, TolFun how to get good results ?
Show older comments
Hello, please i simulated a code for optimization of discrete and continous variables using ga function but I get a result that I do not like and in addition I have this message "Optimization terminated: average change in the penalty fitness value less than options.TolFun and constraint violation is less than options.TolCon. " . How can I improve the results? Thanks thank you
Accepted Answer
More Answers (1)
Alan Weiss
on 4 May 2017
I believe that the best way to get better answers is to use a better algorithm. In this case, first see whether your fitness function and nonlinear constraints are both smooth. If they are, then use fmincon instead of ga, and if you are looking for a global minimum, start from a variety of initial points, such as
x0 = lb + rand(size(lb)).*(ub-lb);
If your fitness function or nonlinear constraints are not smooth, then use patternsearch, again starting from a variety of points.
Seriously, both fmincon and patternsearch are much faster, more reliable and robust, and easier to tune than ga. You will almost certainly be delighted.
Alan Weiss
MATLAB mathematical toolbox documentation
1 Comment
houda mejri
on 4 May 2017
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!