function
Class BitFitnessFunction

java.lang.Object
  extended by function.BitFitnessFunction
All Implemented Interfaces:
FitnessFunctionModel

public class BitFitnessFunction
extends java.lang.Object
implements FitnessFunctionModel

Bit fitness function


Constructor Summary
BitFitnessFunction()
          Creates a new instance of BitFitnessFunction
 
Method Summary
 double getValue(ChromosomeModel chromosome)
          Return fitness value for specified chromosome.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitFitnessFunction

public BitFitnessFunction()
Creates a new instance of BitFitnessFunction

Method Detail

getValue

public double getValue(ChromosomeModel chromosome)
Return fitness value for specified chromosome. Gene in chromosome must be boolean type. Fitness value is calculated according to the function: y = y + i ^2 for i=0 to size of chromosome where:
y fitness function value
i position of gene in chromosome

Specified by:
getValue in interface FitnessFunctionModel
Parameters:
chromosome - Reference to chromosome
Returns:
Value of the fitness function