public interface CrossOverFunction extends Changeable
setChromosomePair
method. Next you would call one of
the performCrossOver
methods to do the crossing and finally you
would retreive the chromsome pair with the getChromosomes
method.Modifier and Type | Interface and Description |
---|---|
static class |
CrossOverFunction.NoCross
A place holder CrossOverFunction that doesn't perform cross overs
|
Modifier and Type | Field and Description |
---|---|
static ChangeType |
CROSS_PROB |
static double[] |
DEFAULT_CROSS_PROB |
static int |
DEFAULT_MAX_CROSS |
static ChangeType |
MAX_CROSSES |
static CrossOverFunction |
NO_CROSS |
Modifier and Type | Method and Description |
---|---|
double[] |
getCrossOverProbs() |
int |
getMaxCrossOvers() |
GACrossResult |
performCrossOver(SymbolList chromA,
SymbolList chromB)
Performs a cross between the pair of chromosomes
|
void |
setCrossOverProbs(double[] crossOverProbs)
Sets the probability of crossing at each base.
|
void |
setMaxCrossOvers(int maxCrossOvers)
Sets an upper limit on the number of crosses.
|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
static final int DEFAULT_MAX_CROSS
static final double[] DEFAULT_CROSS_PROB
static final ChangeType MAX_CROSSES
static final ChangeType CROSS_PROB
static final CrossOverFunction NO_CROSS
GACrossResult performCrossOver(SymbolList chromA, SymbolList chromB) throws ChangeVetoException
chromA
- The first chromosome in the crosschromB
- The second chromosome in the crossGACross
that holds the results of the crossChangeVetoException
- if the chromosomes are unmodifiablevoid setMaxCrossOvers(int maxCrossOvers) throws ChangeVetoException
maxCrossOvers
- the limit on crossesChangeVetoException
- if a ChangeListener vetoes this changeint getMaxCrossOvers()
void setCrossOverProbs(double[] crossOverProbs) throws ChangeVetoException
SymbolList
is given by crossOverProbs[1]
. CrossOverProbs[0]
is effectively
redundant as the cross would occur before the 1st position in the SymbolList
.
By convention if the array is shorter than the SymbolList it is being applied
to then the last value in the array will be applied to every subsequent residue.
The default value in all implementations should be DEFAULT_CROSS_PROB
crossOverProbs
- an array of doubles giving the probability of a
cross occuring at any place.if
- a ChangeListener vetoes the changeChangeVetoException
double[] getCrossOverProbs()
Copyright © 2014 BioJava. All rights reserved.