Interface Evolution<G extends Gene<?,​G>,​C extends Comparable<? super C>>

  • Type Parameters:
    G - the gene type
    C - the fitness result type
    All Known Implementing Classes:
    Engine
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Evolution<G extends Gene<?,​G>,​C extends Comparable<? super C>>
    This functional interface defines the evolution function, which takes an EvolutionStart object, evolves the population, and returns an EvolutionResult object.
    Since:
    5.1
    Version:
    5.1
    • Method Detail

      • evolve

        EvolutionResult<G,​Cevolve​(EvolutionStart<G,​C> start)
        Perform one evolution step with the given evolution start object New phenotypes are created with the fitness function and fitness scaler defined by this engine
        Parameters:
        start - the evolution start object
        Returns:
        the evolution result
        Throws:
        NullPointerException - if the given evolution start is null
        Since:
        3.1
        See Also:
        evolve(ISeq, long)
        API Note:
        The implementation of this method must be thread-safe.
      • evolve

        default EvolutionResult<G,​Cevolve​(ISeq<Phenotype<G,​C>> population,
                                                  long generation)
        Perform one evolution step with the given population and generation.

        This method is thread-safe.

        Parameters:
        population - the population to evolve
        generation - the current generation; used for calculating the phenotype age.
        Returns:
        the evolution result
        Throws:
        NullPointerException - if the given population is null
        IllegalArgumentException - if the given generation is smaller then one
        See Also:
        evolve(EvolutionStart)