JGAP

examples.chromInit
Class MaxFunction

java.lang.Object
  extended by org.jgap.FitnessFunction
      extended by examples.chromInit.MaxFunction
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ICloneable

public class MaxFunction
extends FitnessFunction

Fitness function for our example. See evolve() method for details.

Since:
2.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jgap.FitnessFunction
DELTA, NO_FITNESS_VALUE
 
Constructor Summary
MaxFunction()
           
 
Method Summary
 double evaluate(IChromosome a_subject)
          See examples.simpleBoolean.MaxFunction for description.
 
Methods inherited from class org.jgap.FitnessFunction
clone, getFitnessValue, getLastComputedFitnessValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxFunction

public MaxFunction()
Method Detail

evaluate

public double evaluate(IChromosome a_subject)
See examples.simpleBoolean.MaxFunction for description. Please notice that in this example here, we have chromosomes with one and Chromosomes with two Genes, so that the description from the original MaxFunction does not apply directly here.

Specified by:
evaluate in class FitnessFunction
Parameters:
a_subject - the Chromosome to be evaluated
Returns:
defect rate of our problem
Since:
2.4

JGAP