Package io.jenetics.engine
Interface Evolution<G extends Gene<?,G>,C extends Comparable<? super C>>
-
- Type Parameters:
G
- the gene typeC
- 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 anEvolutionStart
object, evolves the population, and returns anEvolutionResult
object.- Since:
- 5.1
- Version:
- 5.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EvolutionResult<G,C>
evolve(EvolutionStart<G,C> start)
Perform one evolution step with the given evolutionstart
object New phenotypes are created with the fitness function and fitness scaler defined by this enginedefault EvolutionResult<G,C>
evolve(ISeq<Phenotype<G,C>> population, long generation)
Perform one evolution step with the givenpopulation
andgeneration
.
-
-
-
Method Detail
-
evolve
EvolutionResult<G,C> evolve(EvolutionStart<G,C> start)
Perform one evolution step with the given evolutionstart
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 evolutionstart
isnull
- Since:
- 3.1
- See Also:
evolve(ISeq, long)
- API Note:
- The implementation of this method must be thread-safe.
-
evolve
default EvolutionResult<G,C> evolve(ISeq<Phenotype<G,C>> population, long generation)
Perform one evolution step with the givenpopulation
andgeneration
.This method is thread-safe.
- Parameters:
population
- the population to evolvegeneration
- the current generation; used for calculating the phenotype age.- Returns:
- the evolution result
- Throws:
NullPointerException
- if the givenpopulation
isnull
IllegalArgumentException
- if the givengeneration
is smaller then one- See Also:
evolve(EvolutionStart)
-
-