|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CrossOverFunction
Crosses two chromosomes. The basic usage of the class would be
something like choosing two chromosomes that you want to cross over and setting
these with the 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.
Nested Class Summary | |
---|---|
static class |
CrossOverFunction.NoCross
A place holder CrossOverFunction that doesn't perform cross overs |
Field Summary | |
---|---|
static ChangeType |
CROSS_PROB
|
static double[] |
DEFAULT_CROSS_PROB
|
static int |
DEFAULT_MAX_CROSS
|
static ChangeType |
MAX_CROSSES
|
static CrossOverFunction |
NO_CROSS
|
Method Summary | |
---|---|
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. |
Methods inherited from interface org.biojava.utils.Changeable |
---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Field Detail |
---|
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
Method Detail |
---|
GACrossResult performCrossOver(SymbolList chromA, SymbolList chromB) throws ChangeVetoException
chromA
- The first chromosome in the crosschromB
- The second chromosome in the cross
GACross
that holds the results of the cross
ChangeVetoException
- if the chromosomes are unmodifiablevoid setMaxCrossOvers(int maxCrossOvers) throws ChangeVetoException
maxCrossOvers
- the limit on crosses
ChangeVetoException
- 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 change
ChangeVetoException
double[] getCrossOverProbs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |