org.biojava.bio.dist
Interface DistributionTrainer

All Known Implementing Classes:
IgnoreCountsTrainer, SimpleDistributionTrainer

public interface DistributionTrainer

An object that can be used to train a distribution up.

This lets the distribution implementation handle counts or distributions in the best way possible.


Method Summary
 void addCount(DistributionTrainerContext dtc, Symbol res, double times)
          Registers that sym was counted in this state.
 void clearCounts()
          Clears all of the counts to zero.
 void train(Distribution nullModel, double weight)
          Trains the Distribution, given a null model.
 

Method Detail

addCount

public void addCount(DistributionTrainerContext dtc,
                     Symbol res,
                     double times)
              throws IllegalSymbolException
Registers that sym was counted in this state.

This method may be called multiple times with the same symbol. In this case, the times should be summed.

Parameters:
dtc - the DistributionTrainerContext within which the count was added
sym - the Symbol seen
times - the number of times to add

train

public void train(Distribution nullModel,
                  double weight)
           throws IllegalSymbolException
Trains the Distribution, given a null model.

This will use the information collected with multiple addCount calls, and the null model to generate the new weights.

This method should not modify the underlying counts.

Parameters:
nullModel - the null model Distribution
weight - how many lots of the null model to add

clearCounts

public void clearCounts()
Clears all of the counts to zero.