JGAP

examples.simpleBooleanThreaded
Class MaxFunction

java.lang.Object
  extended by org.jgap.FitnessFunction
      extended by examples.simpleBooleanThreaded.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:
3.01
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)
          This example implementation calculates the fitness value of Chromosomes using BooleanAllele implementations.
 
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)
This example implementation calculates the fitness value of Chromosomes using BooleanAllele implementations. Each second bit is expected to be set, each other bit to be not set.

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

JGAP