Package io.jenetics

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

    • Method Detail

      • alter

        AltererResult<G,​Calter​(Seq<Phenotype<G,​C>> population,
                                       long generation)
        Alters (recombine) a given population. If the population is empty, nothing is altered. The altered population is part of the returned AlterResult object.
        Parameters:
        population - The Population to be altered. If the population is null or empty, nothing is altered.
        generation - the date of birth (generation) of the altered phenotypes.
        Returns:
        the alter-result object, which contains the altered population and the alteration count
        Throws:
        NullPointerException - if the given population is null.
      • compose

        default Alterer<G,​Ccompose​(Alterer<G,​C> before)
        Returns a composed alterer that first applies the before alterer to its input, and then applies this alterer to the result.
        Parameters:
        before - the alterer to apply first
        Returns:
        the new composed alterer
      • andThen

        default Alterer<G,​CandThen​(Alterer<G,​C> after)
        Returns a composed alterer that applies the this alterer to its input, and then applies the after alterer to the result.
        Parameters:
        after - the alterer to apply first
        Returns:
        the new composed alterer
      • of

        @SafeVarargs
        static <G extends Gene<?,​G>,​C extends Comparable<? super C>> Alterer<G,​C> of​(Alterer<G,​C>... alterers)
        Combine the given alterers.
        Type Parameters:
        G - the gene type
        C - the fitness function result type
        Parameters:
        alterers - the alterers to combine.
        Returns:
        a new alterer which consists of the given one
        Throws:
        NullPointerException - if one of the alterers is null.