prevent genetic algorithm ga from repeating values

1 次查看(过去 30 天)
I am using genetic algorithm to optimize two variables for a specific function. However, as I thought would be the general demand, I don't want ga to repeat the evaluation of pairs of variables, i.e., I want ga to test only unique pairs of values. There are a few pairs of values that it repeats several times and not only as an elite, but as spawn as well.
I would like to know if it possible to prevent this. Thank you. Best Regards, Pedro

回答(2 个)

Matt J
Matt J 2012-12-21
编辑:Matt J 2012-12-21
Since there are only 2 unknown variables, can't you get a good fix on the global optimum using exhaustive search on an MxN discrete grid of the parameter values? If you restrict your initial population to include the discrete global minimum and points nearby, I'd guess you would not only avoid repetitions, but get very quick convergence as well.
  2 个评论
Pedro
Pedro 2012-12-21
As in most functions, my grid has several local minima. Therefore I would not be able to obtain the global minimum simply by grid search. Furthermore, what you are suggesting, would not guarantee the prevention of repetions, only "faster" convergence.
Matt J
Matt J 2012-12-21
You should at least be able to rule out large regions of local minima. Using the MIN function on a grid of samples would find the global minimum over those samples. If the grid is fine enough relative to how sharply your function varies, that should correspond reasonably closely with the continuous-space global minimum.

请先登录,再进行评论。


Sean de Wolski
Sean de Wolski 2012-12-21
This seems to contradict the theories behind genetic algorithms. The good candidates are supposed to breed and create other good candidates nearby and this is how these algorithms converge.
Also, it is the general recommendation that you should try patternsearch() before using ga()

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by