All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Tally

java.lang.Object
   |
   +----jDisco.Tab
           |
           +----jDisco.Tally

public class Tally
extends jDisco.Tab
This class can be used for collecting time independent data, e.g. the average number of items bought by customers in a supermarket.

Example of use:


     class Customer extends Process {
         static Tally tt = new Tally("Thru times");
public void actions() { double arrivalTime = time(); do shopping; tt.update(time() - arrivalTime); } }
A typicial report:

 title       /  (re)set/   obs/  average/est.st.dv/  minimum/  maximum/    conf./
   Thru times     0.000           18.379    12.576     4.612    38.664     6.438
may be obtained by executing the following code at the end of the simulation:

       Customer.tt.printHeading();
       Customer.tt.report(); 
 

The last column reports the 95% confidence interval half-width. In the example above the average number of customers in the shop is 18.379 ± 6.438 with a confidence level of 95%.

See Also:
jDisco.Tab

Constructor Index

 o Tally(String)
The constructor.

Method Index

 o confidence()
Returns the confidence interval half-width for the default level (0.95).
 o confidence(double)
Returns the confidence interval half-width for a level between 0 and 1.
 o max()
Returns the largest sample value.
 o mean()
Returns the mean.
 o min()
Returns the least sample value.
 o report()
Prints on one-line title, reset time, number of observations, minimum, maximum, mean, standard deviation, and 95% confidence value.
 o reset()
Resets the object.
 o stdDev()
Returns the standard deviation.
 o update(double)
Records a new entry.
 o variance()
Returns the variance.

Constructors

 o Tally
 public Tally(java.lang.String title)
The constructor. An object is instantiated with a title. The length of the title is curtailed to 12 characters should it be longer.

Parameters:
title - the title.

Methods

 o reset
 public void reset()
Resets the object.

Overrides:
reset in class jDisco.Tab
 o update
 public void update(double v)
Records a new entry.

Parameters:
v - the value.
Overrides:
update in class jDisco.Tab
 o report
 public void report()
Prints on one-line title, reset time, number of observations, minimum, maximum, mean, standard deviation, and 95% confidence value.

Overrides:
report in class jDisco.Tab
 o min
 public double min()
Returns the least sample value.

 o max
 public double max()
Returns the largest sample value.

 o mean
 public double mean()
Returns the mean.

 o variance
 public double variance()
Returns the variance.

 o stdDev
 public double stdDev()
Returns the standard deviation.

 o confidence
 public double confidence(double level)
Returns the confidence interval half-width for a level between 0 and 1.

Parameters:
level - the level, eg. 0.95.
 o confidence
 public double confidence()
Returns the confidence interval half-width for the default level (0.95).


All Packages  Class Hierarchy  This Package  Previous  Next  Index