Package com.anylogic.engine.analysis
- Method Summary
- Method Details
- reset
- add
- update
- getNumberOfIntervals
- getPDF
- getMaxPDF
- getCDF
- getStatistics
- count
- mean
- min
- max
- deviation
- meanConfidence
- setCDFEnabled
- isCDFEnabled
- setPercentilesEnabled
- arePercentilesEnabled
- setPercents
- getPercentLow
- getPercentHigh
- getXMin
- getXMax
- getIntervalWidth
- toString
- getPlainDataTable
- destroyUpdater_xjal
- java.lang.Object
- com.anylogic.engine.analysis.ChartItem
- com.anylogic.engine.analysis.HistogramData
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
HistogramSimpleData
,HistogramSmartData
public abstract class HistogramData extends ChartItem
A base class for unidimensional histograms data objects.
Histogram data always calculates the probability distribution function (PDF) and
discrete statistics, and may or may not calculate the cumulative distribution
function (CDF) and low/high percentiles.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Modifier and Type | Method | Description |
---|---|---|
abstract void | add |
Adds a sample data item to the histogram data.
|
boolean | arePercentilesEnabled() |
Checks if percentile calculation is enabled.
|
int | count() |
Returns the number of samples added to the histogram data.
|
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 histogram data.
|
double | getCDF |
Returns the CDF (cumulative distribution function) at the END of the given interval.
|
double | getIntervalWidth() |
Returns the interval width, i.e.
|
double | getMaxPDF() |
Returns the maximum PDF value across all intervals, i.e.
|
int | getNumberOfIntervals() |
Returns the number of intervals in the histogram data.
|
double | getPDF |
Returns the PDF (probability distribution function) at the given interval.
|
double | getPercentHigh() |
Returns the high percent value used for percentile calculation (1 is 100%).
|
double | getPercentLow() |
Returns the low percent value used for percentile calculation (1 is 100%).
|
List<List<Object>> | getPlainDataTable() | |
StatisticsDiscrete | getStatistics() |
Returns the statisctics object embedded into the histogram data.
|
abstract double | getXMax() |
Returns the upper bound of the range covered by intervals.
|
abstract double | getXMin() |
Returns the lower bound of the range covered by intervals.
|
boolean | isCDFEnabled() |
Checks if the CDF calculation is enabled.
|
double | max() |
Returns the maximum sample value, or
-infinity
if no samples have been added. |
double | mean() |
Returns the mean of the histogram.
|
double | meanConfidence() |
Returns the mean confidence interval of the histogram data.
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() |
Fully resets the histogram data: discards all PDF/CDF data and statistics.
|
void | setCDFEnabled |
Enables or disables the CDF calculation.
|
void | setPercentilesEnabled |
Enables or disables calculation of percentiles (the data values corresponding to
a certain low and high percent bounds).
|
void | setPercents |
Sets the percent bounds for percentile calculation.
|
String | toString() |
Returns a tab-separated multi-line textual representation of the histogram data.
|
void | update() |
Should be overridden and call add( val ) if the user has
specified the value to add.
|
public void reset()
Fully resets the histogram data: discards all PDF/CDF data and statistics.
public abstract void add(double val)
Adds a sample data item to the histogram data.
- Parameters:
val
- the sample value
public void update()
Should be overridden and call add( val ) if the user has
specified the value to add. By default does nothing or uses
updater if was created with appropriate constructor.
public int getNumberOfIntervals()
Returns the number of intervals in the histogram data.
- Returns:
- the number of intervals in the histogram data
public double getPDF(int index)
Returns the PDF (probability distribution function) at the given interval.
The PDF is calculated as (number of samples within the interval)/(total nnumber of samples)
- Parameters:
index
- the index of the interval- Returns:
- the PDF of the given interval
public double getMaxPDF()
Returns the maximum PDF value across all intervals, i.e. the maximum number
of hits per interval divided by the total number of samples.
- Returns:
- the maximum PDF value across all intervals
public double getCDF(int index)
Returns the CDF (cumulative distribution function) at the END of the given interval.
The CDF is calculated as (number of samples lower than the end of the interval)/
(total nnumber of samples)
- Parameters:
index
- the index of the interval- Returns:
- the CDF at the END of the given interval
public StatisticsDiscrete getStatistics()
Returns the statisctics object embedded into the histogram data.
- Returns:
- the statisctics object embedded into the histogram data
public int count()
Returns the number of samples added to the histogram data.
- Returns:
- the number of samples added to the histogram data
public double mean()
Returns the mean of the histogram.
- Returns:
- the mean of the histogram
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 deviation()
Returns the standard deviation of the histogram data.
- Returns:
- the standard deviation of the histogram data
public double meanConfidence()
Returns the mean confidence interval of the histogram data.
Interval is calculated for the confidence level of 95%.
Interval is calculated for the confidence level of 95%.
- Returns:
- the mean confidence interval of the histogram data
public void setCDFEnabled(boolean yes)
Enables or disables the CDF calculation. The percentiles are only calculated
if CDF is calculated. Default is enabled.
- Parameters:
yes
- yes iftrue
, calculate CDF
public boolean isCDFEnabled()
Checks if the CDF calculation is enabled.
- Returns:
true
if CDF calculation is enabled,false
otherwise
public void setPercentilesEnabled(boolean yes)
Enables or disables calculation of percentiles (the data values corresponding to
a certain low and high percent bounds). The percentiles are only calculated if CDF
is calculated. Default is enabled. The percentiles tolerance is interval width, i.e.
you will only be able to find out which interval contains the percent bound.
Default is enabled.
- Parameters:
yes
- iftrue
, calculate percentiles
public boolean arePercentilesEnabled()
Checks if percentile calculation is enabled.
- Returns:
true
if percentile calculation is enabled,false
otherwise
public void setPercents(double low, double high)
Sets the percent bounds for percentile calculation. A bound must be between
0 and 1, 1 means 100%. low must be <= (1-high). The default values are 0.1 and 0.1.
- Parameters:
low
- the low percent boundhigh
- the high percent bound
public double getPercentLow()
Returns the low percent value used for percentile calculation (1 is 100%).
- Returns:
- the low percent value
public double getPercentHigh()
Returns the high percent value used for percentile calculation (1 is 100%).
- Returns:
- the high percent value
public abstract double getXMin()
Returns the lower bound of the range covered by intervals.
- Returns:
- the lower bound of the range covered by intervals
public abstract double getXMax()
Returns the upper bound of the range covered by intervals.
- Returns:
- the upper bound of the range covered by intervals
public double getIntervalWidth()
Returns the interval width, i.e. the data range corresponding to one interval.
- Returns:
- the interval width
public String toString()
Returns a tab-separated multi-line textual representation of the histogram data.
@AnyLogicInternalAPI public List<List<Object>> getPlainDataTable()
@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.