Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.operators
Class Replacement<T>

java.lang.Object
  extended by org.uncommons.watchmaker.framework.operators.Replacement<T>
Type Parameters:
T - The type of evolvable entity that this operator applies to.
All Implemented Interfaces:
EvolutionaryOperator<T>

public class Replacement<T>
extends Object
implements EvolutionaryOperator<T>

An evolutionary operator that replaces individuals with randomly-generated new individuals, according to some specified probability. The new individuals are not derived from the selected individuals, they are completely random. This operator provides a way to prevent stagnation by occassionally introducing new genetic material into the population.

Author:
Daniel Dyer

Constructor Summary
Replacement(CandidateFactory<T> factory, NumberGenerator<Probability> replacementProbability)
          Creates a replacement operator that replaces individuals according to a variable probability.
Replacement(CandidateFactory<T> factory, Probability replacementProbability)
          Creates a replacement operator that replaces individuals according to the specified probability.
 
Method Summary
 List<T> apply(List<T> selectedCandidates, Random rng)
          Randomly replace zero or more of the selected candidates with new, independent individuals that are randomly created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replacement

public Replacement(CandidateFactory<T> factory,
                   Probability replacementProbability)
Creates a replacement operator that replaces individuals according to the specified probability. New individuals are obtained from the factory provided.

Parameters:
factory - A source of new individuals.
replacementProbability - The probability that any given individual will be replaced by a new individual. This should typically be quite low. If it is too high, it will undermine the evolutionary progress.

Replacement

public Replacement(CandidateFactory<T> factory,
                   NumberGenerator<Probability> replacementProbability)
Creates a replacement operator that replaces individuals according to a variable probability. New individuals are obtained from the factory provided.

Parameters:
factory - A source of new individuals.
replacementProbability - A NumberGenerator that provides a probability of replacement. The probablity may be constant, or it may change over time. The probability should typically be quite low. If it is too high, it will undermine the evolutionary progress.
Method Detail

apply

public List<T> apply(List<T> selectedCandidates,
                     Random rng)
Randomly replace zero or more of the selected candidates with new, independent individuals that are randomly created.

Specified by:
apply in interface EvolutionaryOperator<T>
Parameters:
selectedCandidates - The selected candidates, some of these may be discarded and replaced with new individuals.
rng - A source of randomness.
Returns:
The remaining candidates after some (or none) have been replaced with new individuals.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)