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).
    • Method Detail

      • getProblem

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