Interface FitnessFunction<T extends Copyable<T>>

Type Parameters:
T - The type of object under optimization.
All Known Subinterfaces:
FitnessFunction.Double<T>, FitnessFunction.Integer<T>
All Known Implementing Classes:
InverseCostFitnessFunction, NegativeCostFitnessFunction, NegativeIntegerCostFitnessFunction

public interface FitnessFunction<T extends Copyable<T>>
Fitness function interfaces. Implement one of the two nested interfaces 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. The difference between the two nested interfaces is only the type of the fitness values (double vs int).
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Fitness function interface for double-valued fitnesses.
    static interface 
    Fitness function interface for int-valued fitnesses.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a reference to the problem that this fitness function is for.
  • Method Details

    • getProblem

      Problem<T> getProblem()
      Gets a reference to the problem that this fitness function is for.
      Returns:
      a reference to the problem.