@evolite/core
    Preparing search index...

    Function fittestSelection

    • Selects the two fittest individuals from the population. *

      Type Parameters

      Parameters

      • population: Entity[]

        The current population of individuals. Must be pre-sorted.

      Returns Promise<[Entity, Entity]>

      A promise that resolves to a tuple containing the two fittest individuals.

      Warning: This function expects the population array to be pre-sorted by fitness in descending order. It is highly efficient but offers no genetic diversity (selection pressure is extremely high). *

      If the population has fewer than 2 individuals.