GPProgramFitnessComparator doing the same comparation twice
Brought to you by:
klausikm
In the method
org.jgap.gp.impl.GPProgramFitnessComparator.compare,
the "if" and "else if" do the same comparation
"m_fitnessEvaluator.isFitter(progOne, progTwo)", so the
"else if" is always false.
Probably it should be
"m_fitnessEvaluator.isFitter(progTwo, progOne)" on the
"else if", but then, the presence of NaN's and
Infinity's breaks the Arrays.sort, resulting in
"ordered blocks" inside the array like this:
100
50
25
10
NaN
70
60
1
NaN
Infinity
20
...
Logged In: YES
user_id=1358314
I think that I posted two bugs with one description. The
second shows up after correctiong the first.
For the second, I think the problem is with the NaN's, but
the Infinity looks ok (Infinity > 20 in the example)
Logged In: YES
user_id=722855
OK, I fixed the first bug. Could you post the second one as
a new bug and describe it a little more clearly? I think
that the sorting happens somewhere else than in
GPProgramFitnessComparator.