AnyLogic AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.analysis.StatisticsContinuous
All Implemented Interfaces:
java.io.Serializable

public class StatisticsContinuous
extends java.lang.Object
implements java.io.Serializable
Statistics on a value that persists in continuous time but changes only at discrete time moments (like e.g. queue length). The samples must be added to this statistics with ascending time stamps. The mean, variance, etc. return data at the time of last update. Also there are alternative methods - with time argument, which assume the last value added holds until the given time.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
StatisticsContinuous()
Creates a continuous statistics.
StatisticsContinuous​(DataUpdater_xjal updater)
Creates a continuous statistics.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void add​(double value, double time)
Adds a new data sample to the statistics, i.e. notifies the statistics about the value change at the given time.
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. in its charts.
double deviation()
Returns the deviation of the statistics at the time of last update.
double deviation​(double time)
Returns the standard deviation of the statistics at the given time assuming the last value added holds until the given time.
double getTimeStart()
This method is needed to calculate totalTime in cloud.
double integral()
Returns the mean integral of the statistics at the time of last update, or 0 if no samples have been added.
double integral​(double time)
Returns the integral of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
double max()
Returns the maximum sample value, or -infinity if no samples have been added.
double mean()
Returns the mean of the statistics at the time of last update, or 0 if no samples have been added.
double mean​(double time)
Returns the mean of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
double meanConfidence()
Returns the mean confidence of the statistics at the time of last update, or 0 if no samples have been added.
Interval is calculated for the confidence level of 95%.
double meanConfidence​(double time)
Returns the mean confidence interval of the statistics at the given time assuming the last value added holds until the given time, or +infinity if less than 2 samples have been added or if no time has elapsed.
Interval is calculated for the confidence level of 95%.
double min()
Returns the minimum sample value, or +infinity if no samples have been added.
void reset()
Discards all statistics accumulated.
java.lang.String toString()
Returns the tab-separated multiline textual representation of the statistics corresponding to the time of last update.
void update()
Should be overridden and call add( val, time() ) if the user has specified the value.
double variance()
Returns the variance of the statistics at the time of last update, or 0 if no samples have been added.
double variance​(double time)
Returns the variance of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
Modifier and Type Method Description

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

StatisticsContinuous

public StatisticsContinuous()
Creates a continuous statistics.

StatisticsContinuous

public StatisticsContinuous​(DataUpdater_xjal updater)
Creates a continuous statistics.
Parameters:
updater - updater which may be used instead of overriding update() method

Method Detail

destroyUpdater_xjal

@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.

count

public int count()
Returns the number of samples added to the statistics.
Returns:
the number of samples added to the statistics.

min

public double min()
Returns the minimum sample value, or +infinity if no samples have been added.
Returns:
the minimum sample value or +infinity

max

public double max()
Returns the maximum sample value, or -infinity if no samples have been added.
Returns:
the maximum sample value or -infinity

mean

public double mean()
Returns the mean of the statistics at the time of last update, or 0 if no samples have been added.
Returns:
the mean of the statistics at the time of last update, or 0

mean

public double mean​(double time)
Returns the mean of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
Parameters:
time - the time
Returns:
the mean of the statistics, or 0

variance

public double variance()
Returns the variance of the statistics at the time of last update, or 0 if no samples have been added.
Returns:
the variance of the statistics at the time of last update, or 0

variance

public double variance​(double time)
Returns the variance of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
Parameters:
time - the time
Returns:
the variance of the statistics, or 0

deviation

public double deviation()
Returns the deviation of the statistics at the time of last update.
Returns:
the deviation of the statistics at the time of last update

deviation

public double deviation​(double time)
Returns the standard deviation of the statistics at the given time assuming the last value added holds until the given time.
Parameters:
time - the time
Returns:
the standard deviation of the statistics

meanConfidence

public double meanConfidence()
Returns the mean confidence of the statistics at the time of last update, or 0 if no samples have been added.
Interval is calculated for the confidence level of 95%.
Returns:
the mean confidence of the statistics at the time of last update, or 0

meanConfidence

public double meanConfidence​(double time)
Returns the mean confidence interval of the statistics at the given time assuming the last value added holds until the given time, or +infinity if less than 2 samples have been added or if no time has elapsed.
Interval is calculated for the confidence level of 95%.
Parameters:
time - the time
Returns:
the mean confidence interval of the statistics, or 0

integral

public double integral()
Returns the mean integral of the statistics at the time of last update, or 0 if no samples have been added.
Returns:
the mean integral of the statistics at the time of last update, or 0

integral

public double integral​(double time)
Returns the integral of the statistics at the given time assuming the last value added holds until the given time, or 0 if no samples have been added.
Parameters:
time - the time
Returns:
the integral of the statistics

reset

public void reset()
Discards all statistics accumulated.

add

public void add​(double value,
                double time)
Adds a new data sample to the statistics, i.e. notifies the statistics about the value change at the given time.
Parameters:
value - the new value
time - the time

update

public void update()
Should be overridden and call add( val, time() ) if the user has specified the value. By default does nothing or uses updater if was created with appropriate constructor.

toString

public java.lang.String toString()
Returns the tab-separated multiline textual representation of the statistics corresponding to the time of last update.
Overrides:
toString in class java.lang.Object
Returns:
the tab-separated textual representation of the statistics

getTimeStart

@AnyLogicInternalAPI
public double getTimeStart()
This method is needed to calculate totalTime in cloud.
Returns:
the moment in MTU when first value was added
How can we improve this article?