Print

Print


On Sep 21, 2009, at 4:22 PM, Torsten Hildebrandt wrote:

> reading the recent messages on this list I have a question concerning
> the comparison of fitness values: shouldn't they be compared
> differently?  An approach to compare for equality would be to check if
> they differ at most a very small value or probably even better using
> an approach like
> http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm) 
> .

It's absolutely true that your approach to computing a fitness value  
could result in numerical instability.  But I think this isn't ECJ's  
concern: regardless of whether nor not the fitness value was computed  
properly, at the end of the day, ECJ doesn't know if you intend small  
differences in float values to be relevant or if they're accidental.

However I've got good news for you!  This is exactly why we made it  
possible to swap out the fitness class.  If you like, just put in a  
subclass which implements these three methods with a little bit of  
slack, and ECJ will handle it fine.  The only selection methods which  
do *not* use the equivalentTo and betterThan methods are the raw- 
numerical methods like Fitness Proportionate Selection, but why are  
you using those anyway?  :-)

Sean