Interface FitnessFunction.Integer<T extends Copyable<T>>

Type Parameters:
T - The type of object under optimization.
All Superinterfaces:
FitnessFunction<T>
All Known Implementing Classes:
NegativeIntegerCostFitnessFunction
Enclosing interface:
FitnessFunction<T extends Copyable<T>>

public static interface FitnessFunction.Integer<T extends Copyable<T>> extends FitnessFunction<T>
Fitness function interface for int-valued fitnesses. Implement this interface to provide a fitness function for use by genetic algorithms and other forms of evolutionary computation. Some of the SelectionOperator classes of this library assume that fitness values are positive, so for maximal compatibility, you should design your fitness function such that fitness values are always positive.
  • Method Details

    • fitness

      int fitness(T candidate)
      Computes the fitness of a candidate solution to a problem, for use by genetic algorithms and other evolutionary algorithms.
      Parameters:
      candidate - The solution whose fitness is to be evaluated.
      Returns:
      the fitness of candidate