Why ga() function is only finding minimum of the fitness function??...
1 次查看(过去 30 天)
显示 更早的评论
I want to know about the ga() function given in Global Optimization Toolbox in MATLAB 2012a....
It is finding the minimum of the fitness function..... What should I do If one need to find the maximum of the fitness function??.... I have to find the maximum fitness value of my fitness function...
One more thing..
There is an option of "Elite Count" in the option structure along with crossover and mutation.... When I am using it, this "Elite Count" is moving only those individuals to the next generation which are of low fitness value...... While in documentation it is written that "individuals with best fitness value automatically survive to the next generation"..... whats going on???...
Is this ga() is working only for finding minimum of the function only???...
plzz explain about it kindly....
0 个评论
回答(3 个)
Matt J
2012-12-20
编辑:Matt J
2012-12-20
Maximizing f(x) is the same as minimizing -f(x), so you can reformulate any maximization problem as a minimization problem.
As for "Elite Count", the documentation sounds consistent with what you are seeing as long as best=lowest, and that would make sense considering that the goal is to make the fitness function as low as possible.
0 个评论
Walter Roberson
2012-12-20
If you need to maximize, then have your function return the negative of what it would normally return, and at the end, take the negative of the ultimate value.
Jonathan Epperl
2012-12-20
Of course you can also use 1/f(x) or exp(-f(x)) or ..., since the Genetic Algorithm's success is basically luck anyway those variants might work much better or much worse than -f(x).
As for the Elite Count parameter, that tells you that the n best individua move to the next generation, unaltered. Whether you write the ga so that that corresponds to a low or high fitness value is probably a matter of taste, but I agree with you, I'd have it so that high fitness means good individuum.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!