Menu

#31 GPProgramFitnessComparator doing the same comparation twice

next JGAP version
closed-fixed
Klaus
9
2006-10-18
2006-10-18
No

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

Discussion

  • Oswaldo Dantas

    Oswaldo Dantas - 2006-10-18

    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)

     
  • Klaus

    Klaus - 2006-10-18
    • labels: --> coding error
    • milestone: --> next JGAP version
    • priority: 5 --> 9
    • assigned_to: nobody --> klausikm
    • status: open --> closed-fixed
     
  • Klaus

    Klaus - 2006-10-18

    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.

     

Log in to post a comment.

MongoDB Logo MongoDB