public class LineCrossover<G extends NumericGene<?,G>,C extends Comparable<? super C>> extends Crossover<G,C>
Points outside of the allowed numeric range are rejected and the original
value are used instead. The strategy on how out-of-range points are handled,
is the difference to the very similar IntermediateCrossover
.
IntermediateCrossover
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
LineCrossover()
Creates a new linear-crossover with default recombination
probability (
Alterer.DEFAULT_ALTER_PROBABILITY ) and a p value
of zero, which restricts the recombined chromosomes within the hypercube
of the selected chromosomes (vectors). |
LineCrossover(double probability)
Creates a new linear-crossover with the given recombination
probability.
|
LineCrossover(double probability,
double p)
Creates a new linear-crossover with the given recombination
probability and the line-scaling factor p.
|
Modifier and Type | Method and Description |
---|---|
protected int |
crossover(MSeq<G> v,
MSeq<G> w)
Template method which performs the crossover.
|
String |
toString() |
alter, getOrder
getProbability
public LineCrossover(double probability, double p)
probability
- the recombination probability.p
- defines the possible location of the recombined chromosomes. If
p = 0 then the children will be located along the line
within the hypercube between the two points. If p > 0
then the children may be located anywhere on the line, even
somewhat outside of the hypercube.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
or if p
is smaller then zeropublic LineCrossover(double probability)
probability
- the recombination probability.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
public LineCrossover()
Alterer.DEFAULT_ALTER_PROBABILITY
) and a p value
of zero, which restricts the recombined chromosomes within the hypercube
of the selected chromosomes (vectors).protected int crossover(MSeq<G> v, MSeq<G> w)
Crossover
crossover
in class Crossover<G extends NumericGene<?,G>,C extends Comparable<? super C>>
v
- the genes of the first chromosomew
- the genes of the other chromosome© 2007-2019 Franz Wilhelmstötter (2019-06-23 15:39)