#35 DeltaGPFitnessEvaluator does not match Interface description

JGAP 3.2
closed-fixed
Klaus
7
2006-12-18
2006-12-16
MiniMax
No

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. :-)

Discussion

  • MiniMax
    MiniMax
    2006-12-17

    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;

     
  • Klaus
    Klaus
    2006-12-17

    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.

     
  • Klaus
    Klaus
    2006-12-17

    • assigned_to: nobody --> klausikm
    • milestone: 659916 --> 483887
    • status: open --> open-fixed
     
  • MiniMax
    MiniMax
    2006-12-17

    Logged In: YES
    user_id=1043913
    Originator: YES

    I have nothing against it, you can close the bug. :-)

     
  • Klaus
    Klaus
    2006-12-17

    Logged In: YES
    user_id=722855
    Originator: NO

    :-)

     
  • Klaus
    Klaus
    2006-12-17

    • status: open-fixed --> closed-fixed
     
  • Klaus
    Klaus
    2006-12-17

    • status: closed-fixed --> open-fixed
     
  • Klaus
    Klaus
    2006-12-17

    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.

     
  • Klaus
    Klaus
    2006-12-18

    • priority: 5 --> 7
    • milestone: 483887 --> JGAP 3.2
    • status: open-fixed --> closed-fixed