public class IntermediateCrossover<G extends NumericGene<?,G>,C extends Comparable<? super C>> extends Crossover<G,C>
Points outside of the allowed numeric range are rejected and a new points are
generated, until they lie in the valid range. The strategy on how
out-of-range points are handled, is the difference to the very similar
LineCrossover
.
LineCrossover
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
IntermediateCrossover()
Creates a new intermediate-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). |
IntermediateCrossover(double probability)
Creates a new intermediate-crossover with the given recombination
probability.
|
IntermediateCrossover(double probability,
double p)
Creates a new intermediate-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.
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
alter, getOrder
getProbability
public IntermediateCrossover(double probability, double p)
When the value for p is greater then 0, the crossover point generation must be repeated until the points lie within the allowed range. Values greater then 10 are usually not recommended, since this leads to unnecessary crossover point generation.
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 IntermediateCrossover(double probability)
probability
- the recombination probability.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
public IntermediateCrossover()
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 chromosomepublic int hashCode()
hashCode
in class AbstractAlterer<G extends NumericGene<?,G>,C extends Comparable<? super C>>
public boolean equals(Object obj)
equals
in class AbstractAlterer<G extends NumericGene<?,G>,C extends Comparable<? super C>>
© 2007-2017 Franz Wilhelmstötter (2017-08-22 19:30)