public static final class CrossOverFunction.NoCross extends Object implements CrossOverFunction
A place holder CrossOverFunction that doesn't perform cross overs
CrossOverFunction.NoCross
CROSS_PROB, DEFAULT_CROSS_PROB, DEFAULT_MAX_CROSS, MAX_CROSSES, NO_CROSS
Constructor and Description |
---|
CrossOverFunction.NoCross() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener cl)
Add a listener that will be informed of all changes.
|
void |
addChangeListener(ChangeListener cl,
ChangeType ct)
Add a listener that will be informed of changes of a given type.
|
double[] |
getCrossOverProbs() |
int |
getMaxCrossOvers() |
boolean |
isUnchanging(ChangeType t)
A particular ChangeType can never be raised by this Changeable.
|
GACrossResult |
performCrossOver(SymbolList chromA,
SymbolList chromB)
Performs a cross between the pair of chromosomes
|
void |
removeChangeListener(ChangeListener c)
Remove a listener that was interested in all types of changes.
|
void |
removeChangeListener(ChangeListener cl,
ChangeType ct)
Remove a listener that was interested in a specific types of changes.
|
void |
setCrossOverProbs(double[] crossOverProb)
Sets the probability of crossing at each base.
|
void |
setMaxCrossOvers(int max)
Sets an upper limit on the number of crosses.
|
public CrossOverFunction.NoCross()
public double[] getCrossOverProbs()
getCrossOverProbs
in interface CrossOverFunction
public int getMaxCrossOvers()
getMaxCrossOvers
in interface CrossOverFunction
public GACrossResult performCrossOver(SymbolList chromA, SymbolList chromB)
CrossOverFunction
performCrossOver
in interface CrossOverFunction
chromA
- The first chromosome in the crosschromB
- The second chromosome in the crossGACross
that holds the results of the crosspublic void setCrossOverProbs(double[] crossOverProb) throws ChangeVetoException
CrossOverFunction
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
setCrossOverProbs
in interface CrossOverFunction
crossOverProb
- an array of doubles giving the probability of a
cross occuring at any place.ChangeVetoException
public void setMaxCrossOvers(int max) throws ChangeVetoException
CrossOverFunction
setMaxCrossOvers
in interface CrossOverFunction
max
- the limit on crossesChangeVetoException
- if a ChangeListener vetoes this changepublic boolean isUnchanging(ChangeType t)
Changeable
A particular ChangeType can never be raised by this Changeable.
If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.
isUnchanging
in interface Changeable
t
- the ChangeType to checkpublic void removeChangeListener(ChangeListener c)
Changeable
removeChangeListener
in interface Changeable
c
- a ChangeListener to removepublic void addChangeListener(ChangeListener cl)
Changeable
addChangeListener
in interface Changeable
cl
- the ChangeListener to addpublic void addChangeListener(ChangeListener cl, ChangeType ct)
Changeable
addChangeListener
in interface Changeable
cl
- the ChangeListenerct
- the ChangeType it is to be informed ofpublic void removeChangeListener(ChangeListener cl, ChangeType ct)
Changeable
removeChangeListener
in interface Changeable
cl
- a ChangeListener to removect
- the ChangeType that it was interested inCopyright © 2014 BioJava. All rights reserved.