|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.uncommons.watchmaker.framework.operators.StringMutation
public class StringMutation
Mutation of individual characters in a string according to some probability.
Constructor Summary | |
---|---|
StringMutation(char[] alphabet,
NumberGenerator<Probability> mutationProbability)
Creates a mutation operator that is applied with the given probability and draws its characters from the specified alphabet. |
|
StringMutation(char[] alphabet,
Probability mutationProbability)
Creates a mutation operator that is applied with the given probability and draws its characters from the specified alphabet. |
Method Summary | |
---|---|
List<String> |
apply(List<String> selectedCandidates,
Random rng)
Apply the operation to each entry in the list of selected candidates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringMutation(char[] alphabet, Probability mutationProbability)
alphabet
- The permitted values for each character in a string.mutationProbability
- The probability that a given character
is changed.public StringMutation(char[] alphabet, NumberGenerator<Probability> mutationProbability)
alphabet
- The permitted values for each character in a string.mutationProbability
- The (possibly variable) probability that a
given character is changed.Method Detail |
---|
public List<String> apply(List<String> selectedCandidates, Random rng)
EvolutionaryOperator
Apply the operation to each entry in the list of selected candidates. It is important to note that this method operates on the list of candidates returned by the selection strategy and not on the current population. Each entry in the list (not each individual - the list may contain the same individual more than once) must be operated on exactly once.
Implementing classes should not assume any particular ordering (or lack of ordering) for the selection. If ordering or shuffling is required, it should be performed by the implementing class. The implementation should not re-order the list provided but instead should make a copy of the list and re-order that. The ordering of the selection should be totally irrelevant for operators that process each candidate in isolation, such as mutation. It should only be an issue for operators, such as cross-over, that deal with multiple candidates in a single operation.
The operator should not modify any of the candidates passed in. Instead it should return a list that contains evolved copies of those candidates (umodified candidates can be included in the results without having to be copied).
apply
in interface EvolutionaryOperator<String>
selectedCandidates
- The individuals to evolve.rng
- A source of randomness for stochastic operators (most
operators will be stochastic).
|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |