Class IdentityOperator<T>

  • Type Parameters:
    T - The type of evolvable entity that this operator is used with.
    All Implemented Interfaces:
    EvolutionaryOperator<T>

    public class IdentityOperator<T>
    extends Object
    implements EvolutionaryOperator<T>
    Evolutionary operator that simply returns the selected candidates unaltered. This can be useful when combined with SplitEvolution so that a proportion of the selected candidates can be copied unaltered into the next generation while the remainder are evolved.
    • Constructor Detail

      • IdentityOperator

        public IdentityOperator()
    • Method Detail

      • apply

        public List<T> apply​(List<T> selectedCandidates,
                             Random rng)
        Returns the selected candidates unaltered.
        Specified by:
        apply in interface EvolutionaryOperator<T>
        Parameters:
        selectedCandidates - The candidates to "evolve" (or do nothing to in this case).
        rng - A source of randomness (not used).
        Returns:
        The unaltered candidates.