|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.bio.dist.AbstractDistribution
An abstract implementation of Distribution.
You will need to over-ride getWeight()
for a simple
implementation. You may also wish to over-ride the other methods if the
default implementation is not suitable.
Note that, in this implementation, the setWeight
implementation
throws an exception. The registerWithTrainer
method registers
an IgnoreCountsTrainer
. To make an AbstractDistribution
subclass trainable, both these methods must be overridden.
Constructor Summary | |
AbstractDistribution()
|
Method Summary | |
protected double |
getAmbiguityWeight(Symbol amb)
Performs the standard munge to handle ambiguity symbols. |
abstract Distribution |
getNullModel()
Retrieve the null model Distribution that this Distribution recognizes. |
void |
registerWithTrainer(DistributionTrainerContext dtc)
Register an IgnoreCountsTrainer instance as the trainer for this distribution. |
Symbol |
sampleSymbol()
Sample a symbol from this state's probability distribution. |
void |
setWeight(Symbol sym,
double weight)
Set the weight of a given symbol in this distribution. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public AbstractDistribution()
Method Detail |
public void setWeight(Symbol sym, double weight) throws IllegalSymbolException, java.lang.UnsupportedOperationException
s
- the Symbol emittedw
- the probability of emitting that symbolprotected double getAmbiguityWeight(Symbol amb) throws IllegalSymbolException
amb
- the AmbiguitySymbol to find the probability ofpublic abstract Distribution getNullModel()
public Symbol sampleSymbol() throws BioError
public void registerWithTrainer(DistributionTrainerContext dtc)
dtc
- the DistributionTrainerContext with witch to register a trainer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |