org.mbari.siam.utils
Class WeightedAverageFilter

java.lang.Object
  extended by org.mbari.siam.utils.Filter
      extended by org.mbari.siam.utils.WeightedAverageFilter

public class WeightedAverageFilter
extends Filter

This filter produces an instantaneous (no memory) weighted average of its inputs. The output is recalculated whenever any of the inputs changes.


Field Summary
 
Fields inherited from class org.mbari.siam.utils.Filter
_log4j, ACTION_CANCEL, ACTION_OK, DEFAULT_ID, DEFAULT_NAME
 
Constructor Summary
WeightedAverageFilter()
           
WeightedAverageFilter(int id, java.util.Vector inputs)
           
WeightedAverageFilter(java.lang.String name, int id)
           
WeightedAverageFilter(java.lang.String name, int id, java.util.Vector inputs)
           
WeightedAverageFilter(java.lang.String name, int id, java.util.Vector inputs, int divisor)
           
WeightedAverageFilter(java.lang.String name, java.util.Vector inputs)
           
WeightedAverageFilter(java.util.Vector inputs)
           
 
Method Summary
protected  int doFilterAction(double value)
          Perform the filter function with the new input value.
 int getDivisor()
          get divisor value
 void setDivisor(int divisor)
          set divisor value
 
Methods inherited from class org.mbari.siam.utils.Filter
addInput, addInputs, attach, doubleValue, floatValue, getID, getInput, getInput, indexOf, inputCount, inputGate, intValue, longValue, name, outputGate, removeAllInputs, removeInput, reset, setID, setName, toString, triggerIn, triggerOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedAverageFilter

public WeightedAverageFilter()

WeightedAverageFilter

public WeightedAverageFilter(java.lang.String name,
                             int id)

WeightedAverageFilter

public WeightedAverageFilter(java.util.Vector inputs)

WeightedAverageFilter

public WeightedAverageFilter(java.lang.String name,
                             java.util.Vector inputs)
                      throws InvalidPropertyException
Throws:
InvalidPropertyException

WeightedAverageFilter

public WeightedAverageFilter(int id,
                             java.util.Vector inputs)
                      throws InvalidPropertyException
Throws:
InvalidPropertyException

WeightedAverageFilter

public WeightedAverageFilter(java.lang.String name,
                             int id,
                             java.util.Vector inputs)
                      throws InvalidPropertyException
Throws:
InvalidPropertyException

WeightedAverageFilter

public WeightedAverageFilter(java.lang.String name,
                             int id,
                             java.util.Vector inputs,
                             int divisor)
                      throws InvalidPropertyException
Throws:
InvalidPropertyException
Method Detail

setDivisor

public void setDivisor(int divisor)
set divisor value


getDivisor

public int getDivisor()
get divisor value


doFilterAction

protected int doFilterAction(double value)
Perform the filter function with the new input value. Sets member variable _filterValue, which will be passed to the output by triggerOut() if the output gating conditions are met. Overrides base class default.

Specified by:
doFilterAction in class Filter


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.