org.uncommons.watchmaker.framework.operators
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 with SplitEvolution
so that a
proportion of the selected candidates can be copied unaltered into the next
generation while the remainder are evolved.
- Author:
- Daniel Dyer
Method Summary |
List<T> |
apply(List<T> selectedCandidates,
Random rng)
Returns the selected candidates unaltered. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IdentityOperator
public IdentityOperator()
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.