ec.cgp
Class FitnessCGP

java.lang.Object
  extended by ec.Fitness
      extended by ec.simple.SimpleFitness
          extended by ec.cgp.FitnessCGP
All Implemented Interfaces:
ec.Prototype, ec.Setup, java.io.Serializable, java.lang.Cloneable

public class FitnessCGP
extends ec.simple.SimpleFitness

Extension of SimpleFitness that makes smaller fitnesses better.

Author:
David Oranchak, doranchak@gmail.com, http://oranchak.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ec.simple.SimpleFitness
fitness, isIdeal
 
Fields inherited from class ec.Fitness
FITNESS_PREAMBLE, P_FITNESS
 
Constructor Summary
FitnessCGP()
           
 
Method Summary
 boolean betterThan(ec.Fitness _fitness)
          Should return true if this fitness is clearly better than _fitness; You may assume that _fitness is of the same class as yourself.
 
Methods inherited from class ec.simple.SimpleFitness
defaultBase, equivalentTo, fitness, fitnessToString, fitnessToStringForHumans, isIdealFitness, readFitness, readFitness, setFitness, setFitness, setup, writeFitness
 
Methods inherited from class ec.Fitness
clone, printFitness, printFitness, printFitnessForHumans
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FitnessCGP

public FitnessCGP()
Method Detail

betterThan

public boolean betterThan(ec.Fitness _fitness)
Description copied from class: ec.Fitness
Should return true if this fitness is clearly better than _fitness; You may assume that _fitness is of the same class as yourself. For any two fitnesses fit1 and fit2 of the same class, it must be the case that fit1.equivalentTo(fit2) == fit2.equivalentTo(fit1), and that only one of fit1.betterThan(fit2), fit1.equivalentTo(fit2), and fit2.betterThan(fit1) can be true.

Overrides:
betterThan in class ec.simple.SimpleFitness