Class IdentityOperator<T>
- java.lang.Object
-
- org.uncommons.watchmaker.framework.operators.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 withSplitEvolution
so that a proportion of the selected candidates can be copied unaltered into the next generation while the remainder are evolved.
-
-
Constructor Summary
Constructors Constructor Description IdentityOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>
apply(List<T> selectedCandidates, Random rng)
Returns the selected candidates unaltered.
-
-
-
Method Detail
-
apply
public List<T> apply(List<T> selectedCandidates, Random rng)
Returns the selected candidates unaltered.- Specified by:
apply
in interfaceEvolutionaryOperator<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.
-
-