public abstract class AbstractCrossOverFunction extends AbstractChangeable implements CrossOverFunction
CrossOverFunction. All custom
implementations should inherit from here.CrossOverFunction.NoCrossCROSS_PROB, DEFAULT_CROSS_PROB, DEFAULT_MAX_CROSS, MAX_CROSSES, NO_CROSS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCrossOverFunction() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
getCrossOverProbs() |
int |
getMaxCrossOvers() |
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, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitperformCrossOveraddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerprotected AbstractCrossOverFunction()
public final void setMaxCrossOvers(int maxCrossOvers) throws ChangeVetoException
CrossOverFunctionsetMaxCrossOvers in interface CrossOverFunctionmaxCrossOvers - the limit on crossesChangeVetoException - if a ChangeListener vetoes this changepublic final int getMaxCrossOvers()
getMaxCrossOvers in interface CrossOverFunctionpublic final void setCrossOverProbs(double[] crossOverProbs) throws ChangeVetoException
CrossOverFunctionSymbolList
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_PROBsetCrossOverProbs in interface CrossOverFunctioncrossOverProbs - an array of doubles giving the probability of a
cross occuring at any place.ChangeVetoExceptionpublic final double[] getCrossOverProbs()
getCrossOverProbs in interface CrossOverFunctionCopyright © 2020 BioJava. All rights reserved.