Menu

#19 getFittestChromosomes semantics?

next JGAP version
closed-fixed
Klaus
9
2006-02-03
2006-02-01
Fanguad
No

What are the semantics if getFittestChromosomes(int) is
called where a_numberOfChromosomes is more than the
total population? Admittedly, this is only really of
concern in test problems where the population size is
unrealistically small, but I think it would be to
define the semantics in the javadoc.

Right now, no bounds checking is performed on the
argument, so an ArrayIndexOutOfBounds exception is thrown.

Discussion

  • Klaus

    Klaus - 2006-02-01

    Logged In: YES
    user_id=722855

    You are right. I added javadoc comments and fixed the code
    as well extending a test case

     
  • Klaus

    Klaus - 2006-02-01
    • labels: --> coding error
    • milestone: --> next JGAP version
    • priority: 5 --> 9
    • assigned_to: nobody --> klausikm
    • status: open --> open-fixed
     
  • Fanguad

    Fanguad - 2006-02-03

    Logged In: YES
    user_id=717728

    Looks good to me. You might want to comment on the line

    assertEquals(4, p.determineFittestChromosomes(5).size());

    in

    testDetermineFittestChromosomes_1(), since it's not
    intuitive why 4 is the correct answer, and not 5 (since the
    four chromosomes are added in a different method).

     
  • Klaus

    Klaus - 2006-02-03
    • status: open-fixed --> closed-fixed
     
  • Klaus

    Klaus - 2006-02-03

    Logged In: YES
    user_id=722855

    OK, good suggestion. I checked in the changed class.

     

Log in to post a comment.

MongoDB Logo MongoDB