- status: open --> closed-fixed
As mailed by Umut:
---
The bug is in the toString() method of the chromosome
on line 505:
representation.append(", " + S_FITNESS_VALUE + ":" +
getFitnessValue());
And in getFitnessValue method:
if (m_fitnessValue >= 0.000d) {
return m_fitnessValue;
}
else {
return calcFitnessValue();
}
The problem is that whenever I want to see the
chromosome in the eclipse debug window toString method
of the chromosome is called. And what is worse,
eclipse does not stop in the breakpoints or
watchpoints when the call is made from the debug
window (at least this is what I experienced). The
problem can be solved with changing line 505 to
representation.append(", " + S_FITNESS_VALUE + ":" +
m_fitnessValue);
if it is -1, then the users can at least understand
they need to initialize the value.
---
My answer:
I fixed the bug as you suggested and modified the
tests testToString_1 and testToString_1 in class
ChromosomeTest to expose the bug.
When running all tests, it came out that in
Genotype.toString() (calling Chromosome.toString()) a
change was necessary, too.
I've just checked in the changed sources (classes
Chromosome, ChromosomeTest, Genotype, GenotypeTest) to
the CVS.