G
- the gene type.public abstract class Crossover<G extends Gene<?,G>> extends Recombinator<G>
Performs a
Crossover of two Chromosome
.
The order (Recombinator.getOrder()
) of this Recombination implementation is two.
_probability, DEFAULT_ALTER_PROBABILITY
Modifier | Constructor and Description |
---|---|
protected |
Crossover(double probability)
Constructs an alterer with a given recombination probability.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
crossover(MSeq<G> that,
MSeq<G> other)
Template method which performs the crossover.
|
protected <C extends Comparable<? super C>> |
recombine(Population<G,C> population,
int[] individuals,
int generation)
Recombination template method.
|
alter, getOrder
equals, getProbability, hashCode, Null
protected Crossover(double probability)
probability
- The recombination probability.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
.protected final <C extends Comparable<? super C>> int recombine(Population<G,C> population, int[] individuals, int generation)
Recombinator
recombine
in class Recombinator<G extends Gene<?,G>>
C
- the fitness result typepopulation
- 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.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)