public final class MeanAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>> extends Recombinator<G,C>
The order (Recombinator.getOrder()
) of this Recombination implementation is two.
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
MeanAlterer()
Create a new alterer with alter probability of
0.05 . |
MeanAlterer(double probability)
Constructs an alterer with a given recombination probability.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
protected int |
recombine(MSeq<Phenotype<G,C>> population,
int[] individuals,
long generation)
Recombination template method.
|
String |
toString() |
alter, getOrder
getProbability
public MeanAlterer(double probability)
probability
- the crossover probability.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
.public MeanAlterer()
0.05
.protected int recombine(MSeq<Phenotype<G,C>> population, int[] individuals, long generation)
Recombinator
recombine
in class Recombinator<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>>
population
- the population to recombineindividuals
- the array with the indexes of the individuals which
are involved in the recombination step. The length of the
array is Recombinator.getOrder()
. The first individual is the
primary individual.generation
- the current generation.public int hashCode()
hashCode
in class AbstractAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>>
public boolean equals(Object obj)
equals
in class AbstractAlterer<G extends Gene<?,G> & Mean<G>,C extends Comparable<? super C>>
© 2007-2017 Franz Wilhelmstötter (2017-11-16 19:35)