simnet
Class Histogram

java.lang.Object
  extended bysimnet.Histogram

public class Histogram
extends java.lang.Object

Keeps a histogram about a set of data points, and computes the average and standard deviation of its data points. The first slice is from 1-resolution second slice is from resolution+1 to 2*resolution the n-th slice is from (n-1)*resolution+1 to n*resolution There are seperate statistics for 0 (and less) and greater then resolution*slices


Field Summary
protected  int acc_count
           
protected  long count_high
           
protected  long count_low
           
protected  long[] count_slices
           
protected  long count_total
           
static double[] DEFAULT_ORDER_STATS
          The default order statistics to compute.
static int GRAPH_WIDTH
          The width of all Histograms.
protected  long max_observed
           
protected  double[] order_stats
          Which order statistics to estimate
protected  java.lang.String os
           
protected  int os_idx
           
protected  int resolution
          The size of big each "slice".
protected  int slices
          The number of slices to maintain.
protected  double ss
           
protected  double sum
           
 
Constructor Summary
Histogram(int resolution, int slices)
          Create a histogram with the specificed slice resolution and number of slices.
Histogram(int resolution, int slices, double[] order_stats)
          Create a histogram with the specificed slice resolution, number of slices, and the specific order statistics specified.
 
Method Summary
 void clear()
          Clears this histogram.
protected  void doActualRecord(int stat)
          The internal function which actually records the given value.
 double getAverage()
          Returns the average of the data points collected.
 long getCount()
          Returns the number of data points collected.
protected  java.lang.String getGraphLine(java.lang.String start, java.lang.String stop, long count, long max)
          Return the output line for the given range with the given count.
 double getStdDev()
          Returns the (population) standard deviation of the data points collected.
 void record(double stat)
          Record the specified value (rouned up with Math.ceil).
 void record(int stat)
          Record the specified value.
 java.lang.String toString()
          Return the full representation histogram.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GRAPH_WIDTH

public static final int GRAPH_WIDTH
The width of all Histograms.

See Also:
Constant Field Values

DEFAULT_ORDER_STATS

public static final double[] DEFAULT_ORDER_STATS
The default order statistics to compute.


resolution

protected int resolution
The size of big each "slice".


slices

protected int slices
The number of slices to maintain.


order_stats

protected double[] order_stats
Which order statistics to estimate


count_total

protected long count_total

count_low

protected long count_low

count_slices

protected long[] count_slices

count_high

protected long count_high

max_observed

protected long max_observed

sum

protected double sum

ss

protected double ss

os_idx

protected int os_idx

os

protected java.lang.String os

acc_count

protected int acc_count
Constructor Detail

Histogram

public Histogram(int resolution,
                 int slices)
Create a histogram with the specificed slice resolution and number of slices.


Histogram

public Histogram(int resolution,
                 int slices,
                 double[] order_stats)
Create a histogram with the specificed slice resolution, number of slices, and the specific order statistics specified.

Method Detail

clear

public void clear()
Clears this histogram.


record

public void record(double stat)
Record the specified value (rouned up with Math.ceil).


record

public void record(int stat)
Record the specified value.


doActualRecord

protected void doActualRecord(int stat)
The internal function which actually records the given value.


getGraphLine

protected java.lang.String getGraphLine(java.lang.String start,
                                        java.lang.String stop,
                                        long count,
                                        long max)
Return the output line for the given range with the given count.


toString

public java.lang.String toString()
Return the full representation histogram.


getCount

public long getCount()
Returns the number of data points collected.


getAverage

public double getAverage()
Returns the average of the data points collected.


getStdDev

public double getStdDev()
Returns the (population) standard deviation of the data points collected.