Package com.anylogic.engine.analysis
- java.lang.Object
- com.anylogic.engine.analysis.StatisticsDiscrete
- All Implemented Interfaces:
Serializable
public class StatisticsDiscrete extends Object implements Serializable
Statistics on a series of data samples of type double. Compared to
StatisticsContinuous, data samples here have no relation to time
(like e.g. products cost or patients LOS).
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
StatisticsDiscrete() |
Creates a discrete statistics.
|
StatisticsDiscrete |
Creates a discrete statistics.
|
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds a sample value to the statistics.
|
int | count() |
Returns the number of samples added to the statistics.
|
void | destroyUpdater_xjal() |
This method is used to 'disconnect' this data class from the
agent/experiment this object was defined in.
It is usually called on agent destroy so that experiment could use this data object e.g. |
double | deviation() |
Returns the standard deviation of the statistics.
|
double | max() |
Returns the maximum sample value, or
-infinity
if no samples have been added. |
double | mean() |
Returns the mean of the statistics, or 0 if no samples have been added.
|
double | meanConfidence() |
Returns the mean confidence interval of the statistics, or
0 if no
samples have been added. |
double | min() |
Returns the minimum sample value, or
+infinity
if no samples have been added. |
void | reset() |
Discards all statistics accumulated.
|
double | sum() |
The method returns sum of the samples added to the statistics,
or 0 if no samples have been added.
|
String | toString() |
Returns the tab-separated multiline textual representation of the statistics.
|
void | update() |
Should be overridden and call add( val ) if the user has
specified the value.
|
double | variance() |
Returns the variance of the statistics, or 0 if less than 2 samples have been added.
|
public StatisticsDiscrete()
Creates a discrete statistics.
public StatisticsDiscrete(DataUpdater_xjal updater)
Creates a discrete statistics.
- Parameters:
updater
- updater which may be used instead of overridingupdate()
method
@AnyLogicInternalCodegenAPI public void destroyUpdater_xjal()
This method is used to 'disconnect' this data class from the
agent/experiment this object was defined in.
It is usually called on agent destroy so that experiment could use this data object e.g. in its charts.
It is usually called on agent destroy so that experiment could use this data object e.g. in its charts.
public int count()
Returns the number of samples added to the statistics.
- Returns:
- the number of samples added to the statistics.
public double min()
Returns the minimum sample value, or
+infinity
if no samples have been added.- Returns:
- the minimum sample value or
+infinity
public double max()
Returns the maximum sample value, or
-infinity
if no samples have been added.- Returns:
- the maximum sample value or
-infinity
public double mean()
Returns the mean of the statistics, or 0 if no samples have been added.
- Returns:
- the mean of the statistics, or 0
public double variance()
Returns the variance of the statistics, or 0 if less than 2 samples have been added.
- Returns:
- the variance of the statistics, or 0
public double deviation()
Returns the standard deviation of the statistics.
- Returns:
- the standard deviation of the statistics
public double meanConfidence()
Returns the mean confidence interval of the statistics, or
Interval is calculated for the confidence level of 95%.
0
if no
samples have been added. Returns +infinity
if only one
sample has been added so farInterval is calculated for the confidence level of 95%.
- Returns:
- the mean confidence interval of the statistics, or 0, or
+infinity
public double sum()
The method returns sum of the samples added to the statistics,
or 0 if no samples have been added.
- Returns:
- sum of the samples add to the statistics, or 0
public void reset()
Discards all statistics accumulated.
public void add(double value)
Adds a sample value to the statistics.
- Parameters:
value
- the value being added
public void update()
Should be overridden and call add( val ) if the user has
specified the value. By default does nothing or uses
updater if was created with appropriate constructor.
public String toString()
Returns the tab-separated multiline textual representation of the statistics.