com.rubecula.darwin.domain.genetics
Class Mutator_Random
java.lang.Object
net.sf.tostring0.AToString
com.rubecula.darwin.domain.genetics.Mutator_
com.rubecula.darwin.domain.genetics.Mutator_Random
- All Implemented Interfaces:
- Chancy, Mutator, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString
- Direct Known Subclasses:
- Mutator_PepperedMoth, Mutator_TS
public class Mutator_Random
- extends Mutator_
- implements Chancy
Lifespan: permanent.
This type of mutator uses a random number generator to determine whether or
not to mutate. It implements the Chancy interface.
All new instances of this type construct new Randomizer
instances.
- Author:
- Robin Hillyard
Fields inherited from class com.rubecula.darwin.domain.genetics.Mutator_ |
LOG |
Fields inherited from interface net.sf.tostring0.IToString |
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE |
Constructor Summary |
Mutator_Random(org.apache.commons.math.random.RandomGenerator random)
|
Mutator_Random(org.apache.commons.math.random.RandomGenerator random,
int odds)
|
Mutator_Random(org.apache.commons.math.random.RandomGenerator random,
int[] bands)
TEST |
Methods inherited from class net.sf.tostring0.AToString |
toString, toString, toStringBrief, toStringId |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
_random
protected final Randomizer _random
Mutator_Random
public Mutator_Random(org.apache.commons.math.random.RandomGenerator random)
- Parameters:
random
-
Mutator_Random
public Mutator_Random(org.apache.commons.math.random.RandomGenerator random,
int odds)
- Parameters:
random
- odds
-
Mutator_Random
public Mutator_Random(org.apache.commons.math.random.RandomGenerator random,
int[] bands)
- TEST
- Parameters:
random
- bands
-
mutate
public Allele mutate(Allele allele)
- Description copied from class:
Mutator_
- By default, the allele is returned unchanged.
TEST
- Specified by:
mutate
in interface Mutator
- Overrides:
mutate
in class Mutator_
- Parameters:
allele
- the original allele
- Returns:
- either the original allele or a mutated version of it.
TODO it seems to me now that this mutation should operate on a
Gene, not on an Allele, but there again we have to remember that
the word "gene" is used in two different ways in common parlance.
- See Also:
Mutator_.mutate(com.rubecula.darwin.domain.helper.Allele)
setBands
public void setBands(int[] bands)
- Parameters:
bands
-
setOdds
public void setOdds(int odds)
- XXX
- Specified by:
setOdds
in interface Chancy
- See Also:
Chancy.setOdds(int)
getRandom
protected Randomizer getRandom()
Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.