Why ga() function is only finding minimum of the fitness function??...
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (3)
Matt J
el 20 de Dic. de 2012
Editada: Matt J
el 20 de Dic. de 2012
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 comentarios
Walter Roberson
el 20 de Dic. de 2012
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
el 20 de Dic. de 2012
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 comentarios
Ver también
Categorías
Más información sobre Genetic Algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!