Class MaxFrequencyFilter

java.lang.Object
_global.tri.oxidationstates.calculator.frequency.MaxFrequencyFilter
All Implemented Interfaces:
matsci.util.arrays.ArrayIndexer.Filter

public class MaxFrequencyFilter extends Object implements matsci.util.arrays.ArrayIndexer.Filter
This is used to screen out families of oxidation state assignments that can't possibly be better than the best one found so far. For example, if the best frequency score so far is 0.9, then all set of ions containing an ion with frequency less than 0.9 should be filtered out.
  • Constructor Details

    • MaxFrequencyFilter

      public MaxFrequencyFilter(FrequencyCalculator calculator, IonFactory.Ion[][] allowedIons)
      Initialize the filter.
      Parameters:
      calculator - The calculator that will be used to evaluate the frequencies of ions
      allowedIons - The allowed ions in this search. The indexing of this array should correspond to the currentState array, so that allowedIons[i][currenState[i]] is the ion that would be assigned in that state.
  • Method Details

    • setMaxKnownFrequencyScore

      public void setMaxKnownFrequencyScore(double value)
      The maximum valid frequency score found so far. We set this externally in case a state that passes this filter is screened out by some other filter. Only frequency scores for states that pass all filters should be set here.
      Parameters:
      value - The maximum frequency score for a valid state encountered so far.
    • getMaxKnownFrequencyScore

      public double getMaxKnownFrequencyScore()
      Returns the maximum frequency score for a valid state encountered so far, as set by the user.
      Returns:
      the maximum frequency score for a valid state encountered so far, as set by the user.
    • getLastValidFrequencyScore

      public double getLastValidFrequencyScore()
      Get the last frequency score that passed this filter.
      Returns:
      the last frequency score that passed this filter.
    • getBranchIndex

      public int getBranchIndex(int[] currentState)
      Specified by:
      getBranchIndex in interface matsci.util.arrays.ArrayIndexer.Filter