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
-
Accumulate(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 the following status information on one line:
title, reset time, number of observations, average,
standard deviation, minimum, maximum, confidence.
-
reset()
- Resets the object.
-
stdDev()
- Returns the standard deviation.
-
update(double)
- Records a new entry.
-
variance()
- Returns the variance.
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.
reset
public void reset()
- Resets the object.
- Overrides:
- reset in class jDisco.Tab
update
public void update(double v)
- Records a new entry.
- Overrides:
- update in class jDisco.Tab
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
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