com.threerings.tudey.util
Class TruncatedAverage

java.lang.Object
  extended by com.threerings.media.util.TrailingAverage
      extended by com.threerings.tudey.util.TruncatedAverage

public class TruncatedAverage
extends com.threerings.media.util.TrailingAverage

Like TrailingAverage, but attempts to exclude outliers (caused by periodic garbage collection, e.g.) by removing the lowest and highest values.


Constructor Summary
TruncatedAverage()
          Creates a new truncated average that records the last ten values and omits the three highest and lowest when computing the average.
TruncatedAverage(int history, int omitLowest, int omitHighest)
          Creates a new truncated average that records the specified number of values and omits the given number of values at the higher and lower ends.
 
Method Summary
 void record(int value)
           
 int value()
           
 
Methods inherited from class com.threerings.media.util.TrailingAverage
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TruncatedAverage

public TruncatedAverage()
Creates a new truncated average that records the last ten values and omits the three highest and lowest when computing the average.


TruncatedAverage

public TruncatedAverage(int history,
                        int omitLowest,
                        int omitHighest)
Creates a new truncated average that records the specified number of values and omits the given number of values at the higher and lower ends.

Method Detail

record

public void record(int value)
Overrides:
record in class com.threerings.media.util.TrailingAverage

value

public int value()
Overrides:
value in class com.threerings.media.util.TrailingAverage


Copyright © 2011. All Rights Reserved.