#51 Fitness value does not always survive Chromosome.clone()

next JGAP version
closed-accepted
Klaus
7
2009-03-14
2009-02-03
Dan F
No

It looks to me as if the fitness value is only copied if there is not a Chromosome from the pool.

I checked that this bug still exists in the current distribution.

A patch:

--- src/org/jgap/Chromosome.java (revision 1514)
+++ src/org/jgap/Chromosome.java (working copy)
@@ -376,8 +376,8 @@
else {
copy = new Chromosome(getConfiguration());
}
- copy.setFitnessValue(m_fitnessValue);
}
+ copy.setFitnessValue(m_fitnessValue);
// Clone constraint checker.
// -------------------------
copy.setConstraintChecker(getConstraintChecker());

Discussion

  • Klaus

    Klaus - 2009-02-04

    Thanx for your report and the hint for removing the bug. I will check it and fix the bug til end of the week.

     
  • Klaus

    Klaus - 2009-02-04
    • priority: 5 --> 7
    • assigned_to: nobody --> klausikm
     
  • Klaus

    Klaus - 2009-03-14
    • milestone: 734231 --> next JGAP version
    • status: open --> closed-accepted
     
  • Klaus

    Klaus - 2009-03-14

    Sorry for the delay. Fixed it according to your patch.

     

Log in to post a comment.