The initial fitness evaluator in GPConfiguration is DeltaGPFitnessEvaluator but DeltaGPFitnessEvaluator does not match to the specification of the interface IGPFitnessEvaluator. The javadoc comment in IGPFitnessEvaluator.isFitter(...) is:
Compares the first given fitness value with the second and returns true if the first one is greater than the second one.
The DeltaGPFitnessEvaluator changes this meaning which may be Ok in some situations. But it should not be the default implementation like it is now in GPConfiguration.init(). My system always returned the worst program instead of the best. :-(
For my system it is not a problem any more because setting the old DefaultGPFitnessEvaluator in GPConfiguration solves the problem. :-)
Logged In: YES
user_id=1043913
Originator: YES
My last assertion was wrong, setting the old DefaultGPFitnessEvaluator in GPConfiguration does not solve the problem. The method GPGenotype.calcFitness has to be adapted, too. Line 405 must be changed from:
/**@todo do something similar here as with Genotype.preserveFittestChromosome*/
if (m_allTimeBest == null
|| m_bestFitness < m_allTimeBest.getFitnessValue()) {
m_allTimeBest = best;
to:
/**@todo do something similar here as with Genotype.preserveFittestChromosome*/
if (m_allTimeBest == null
|| evaluator.isFitter(m_bestFitness, m_allTimeBest.getFitnessValue())) {
m_allTimeBest = best;
Logged In: YES
user_id=722855
Originator: NO
Absolutely right! I changed the javadoc on IGPFitnessEvaluator and set the DefaultGPFitnessEvaluator in GPConfiguration.init. Additionally, I changed GPGenotype as you suggested. Thanx a lot for your great feedback!
If there's nothing against it, I will soon close this bug.
Logged In: YES
user_id=1043913
Originator: YES
I have nothing against it, you can close the bug. :-)
Logged In: YES
user_id=722855
Originator: NO
:-)
Logged In: YES
user_id=722855
Originator: NO
Absolutely right! I changed the javadoc on IGPFitnessEvaluator and set the DefaultGPFitnessEvaluator in GPConfiguration.init. Additionally, I changed GPGenotype as you suggested. Thanx a lot for your great feedback!
If there's nothing against it, I will soon close this bug.