public class SinglePointCrossover<G extends Gene<?,G>,C extends Comparable<? super C>> extends MultiPointCrossover<G,C>
One or two children are created by taking two parent strings and cutting them at some randomly chosen site. E.g.
If we create a child and its complement we preserving the total number of genes in the population, preventing any genetic drift. Single-point crossover is the classic form of crossover. However, it produces very slow mixing compared with multi-point crossover or uniform crossover. For problems where the site position has some intrinsic meaning to the problem single-point crossover can lead to small disruption than multi-point or uniform crossover.
MultiPointCrossover
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
SinglePointCrossover()
Create a new single point crossover object with crossover probability of
0.05 . |
SinglePointCrossover(double probability)
Constructs an alterer with a given recombination probability.
|
Modifier and Type | Method and Description |
---|---|
protected int |
crossover(MSeq<G> that,
MSeq<G> other)
Template method which performs the crossover.
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
getN
alter, getOrder
getProbability
public SinglePointCrossover(double probability)
probability
- the crossover probability.IllegalArgumentException
- if the probability
is not in the
valid range of [0, 1]
.public SinglePointCrossover()
0.05
.protected int crossover(MSeq<G> that, MSeq<G> other)
Crossover
crossover
in class MultiPointCrossover<G extends Gene<?,G>,C extends Comparable<? super C>>
that
- the genes of the first chromosomeother
- the genes of the other chromosomepublic int hashCode()
hashCode
in class MultiPointCrossover<G extends Gene<?,G>,C extends Comparable<? super C>>
public boolean equals(Object obj)
equals
in class MultiPointCrossover<G extends Gene<?,G>,C extends Comparable<? super C>>
public String toString()
toString
in class MultiPointCrossover<G extends Gene<?,G>,C extends Comparable<? super C>>
© 2007-2017 Franz Wilhelmstötter (2017-04-28 16:50)