## org.biojava.bio.dist
Interface DistributionTrainerContext

All Known Subinterfaces:
  ModelTrainer

All Known Implementing Classes:
  SimpleDistributionTrainerContext

public interface DistributionTrainerContext

A context within a group of DistributionTrainers can be trained together.

Author:
  Matthew Pocock

Method Summary
`void` `addCount(Distribution dist, Symbol sym, double times)` Registers that sym was counted in this state.
`void` `clearDistributionCounts()` Clears all of the counts to zero.
`DistributionTrainer` `getDistributionTrainer(Distribution dist)` Return the Distribution trainer object from the current context.
`void` `registerDistribution(Distribution dist)` Register a distribution object
`void` `registerDistributionTrainer(Distribution dist, DistributionTrainer trainer)` Register a distribution and an associated distributiontrainer object
`void` `trainDistributions()` Trains the Distribution, given a null model.

Method Detail

### registerDistribution

    public void registerDistribution(Distribution dist)

  Register a distribution object

### registerDistributionTrainer

    public void registerDistributionTrainer(Distribution dist,
                                            DistributionTrainer trainer)

  Register a distribution and an associated distributiontrainer object
  Parameters:
    `dist` - the distribution to be registered.
    `trainer` - the distribution's trainer object to be registered.

### getDistributionTrainer

    public DistributionTrainer getDistributionTrainer(Distribution dist)

  Return the Distribution trainer object from the current context.
  Parameters:
    `dist` - the Distribution whose trainer is required.

### addCount

    public void addCount(Distribution dist,
                         Symbol sym,
                         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:
    `dist` - the Distribution that the symbol was associated with
    `sym` - the Symbol seen
    `times` - the number of times to add

### trainDistributions

    public void trainDistributions()
                            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.

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

### clearDistributionCounts

    public void clearDistributionCounts()

  Clears all of the counts to zero.