JGAP

examples.equalDistribution
Class SampleFitnessFunction

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

public class SampleFitnessFunction
extends FitnessFunction

Fitness function for our example. See method evaluate(..).

Since:
3.2
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jgap.FitnessFunction
DELTA, NO_FITNESS_VALUE
 
Constructor Summary
SampleFitnessFunction(Vent[] a_vents)
           
 
Method Summary
 double evaluate(IChromosome a_subject)
          Calculates the difference in weight between the 8 groups of vents.
 
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

SampleFitnessFunction

public SampleFitnessFunction(Vent[] a_vents)
Method Detail

evaluate

public double evaluate(IChromosome a_subject)
Calculates the difference in weight between the 8 groups of vents. The lower the different the better the solution.

Specified by:
evaluate in class FitnessFunction
Parameters:
a_subject - the Chromosome to be evaluated
Returns:
fitness of our problem (smaller is better here)
Since:
3.2

JGAP