Class Persistent<U extends Unit<U>,T extends AbstractDoubleScalarRel<U,T>,W extends Number>
- java.lang.Object
-
- org.opentrafficsim.kpi.sampling.indicator.Persistent<U,T,W>
-
- Type Parameters:
U
- unit of the valueT
- class of the valueW
- weight class
public class Persistent<U extends Unit<U>,T extends AbstractDoubleScalarRel<U,T>,W extends Number> extends Object
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 17 okt. 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Constructor Summary
Constructors Constructor Description Persistent(U displayUnit)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(T value, W weight)
Adds a value with given weight to the persistent.Persistent<U,T,W>
copy()
Creates a copy.ConfidenceInterval<T>
getConfidenceInterval(double alpha)
ConfidenceInterval<T>
getConfidenceInterval(double alpha, IntervalSide side)
T
getMax()
T
getMean()
T
getMin()
long
getN()
T
getStDev()
T
getSum()
double
getVariance()
String
toString()
-
-
-
Constructor Detail
-
Persistent
public Persistent(U displayUnit)
Constructor.- Parameters:
displayUnit
- U; unit used for displaying the persistent values, minimum, maximum, mean, etc.
-
-
Method Detail
-
copy
public Persistent<U,T,W> copy()
Creates a copy.- Returns:
- a copy
-
addValue
public void addValue(T value, W weight)
Adds a value with given weight to the persistent.- Parameters:
value
- T; the valueweight
- W; the weight
-
getConfidenceInterval
public ConfidenceInterval<T> getConfidenceInterval(double alpha)
- Parameters:
alpha
- double; confidence level- Returns:
- both-side confidence interval
-
getConfidenceInterval
public ConfidenceInterval<T> getConfidenceInterval(double alpha, IntervalSide side)
- Parameters:
alpha
- double; confidence levelside
- IntervalSide; side of confidence interval- Returns:
- confidence interval
-
getMin
public T getMin()
- Returns:
- min value
-
getMax
public T getMax()
- Returns:
- max value
-
getN
public long getN()
- Returns:
- number of measurments
-
getMean
public T getMean()
- Returns:
- mean value
-
getVariance
public double getVariance()
- Returns:
- variance in si
-
getStDev
public T getStDev()
- Returns:
- standard deviation
-
getSum
public T getSum()
- Returns:
- sum
-
-