All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Accumulate

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

public class Accumulate
extends jDisco.Tab
This class can be used for collecting time dependent data, e.g. the average number of customers in a super market.

Example of use:


     class Customer extends Process {
         static int n = 0;
         static Accumulate no = new Accumulate("No. in shop");
public void actions() { no.update(++n); do shopping; no.update(--n); } }
A typcial report:

 title       /  (re)set/   obs/  average/est.st.dv/  minimum/  maximum/     conf./
  No. in shop     0.000   1322     3.501     3.569     0.000    16.000      0.193
 
may be obtained by executing the following code at the end of the simulation:

     Customer.no.printHeading();
     Customer.no.report();
The last column reports the 95% confidence interval half-width. In the example above the average number of customers in the shop is 3.501 ± 0.193 with a confidence level of 95%.

See Also:
jDisco.Tab

Constructor Index

 o Accumulate(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 the following status information on one line:
title, reset time, number of observations, average, standard deviation, minimum, maximum, confidence.
 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 Accumulate
 public Accumulate(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.

Overrides:
update in class jDisco.Tab
 o report
 public void report()
Prints the following status information on one line:
title, reset time, number of observations, average, standard deviation, minimum, maximum, confidence.

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