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
-
Tally(String)
- The constructor.
-
confidence()
- Returns the confidence interval half-width for the default level (0.95).
-
confidence(double)
- Returns the confidence interval half-width for a level between 0 and 1.
-
max()
- Returns the largest sample value.
-
mean()
- Returns the mean.
-
min()
- Returns the least sample value.
-
report()
- Prints on one-line title, reset time, number of observations, minimum,
maximum, mean, standard deviation, and 95% confidence value.
-
reset()
- Resets the object.
-
stdDev()
- Returns the standard deviation.
-
update(double)
- Records a new entry.
-
variance()
- Returns the variance.
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.
reset
public void reset()
- Resets the object.
- Overrides:
- reset in class jDisco.Tab
update
public void update(double v)
- Records a new entry.
- Parameters:
- v - the value.
- Overrides:
- update in class jDisco.Tab
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
min
public double min()
- Returns the least sample value.
max
public double max()
- Returns the largest sample value.
mean
public double mean()
- Returns the mean.
variance
public double variance()
- Returns the variance.
stdDev
public double stdDev()
- Returns the standard deviation.
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.
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