Package microsim.statistics.functions
Class MultiTraceFunction.Long
java.lang.Object
microsim.statistics.functions.MultiTraceFunction
microsim.statistics.functions.MultiTraceFunction.Long
- All Implemented Interfaces:
EventListener
,DoubleSource
,LongSource
,UpdatableSource
- Enclosing class:
MultiTraceFunction
An implementation of the Memoryless Series class, which manages long type data sources.
-
Nested Class Summary
Nested classes/interfaces inherited from class microsim.statistics.functions.MultiTraceFunction
MultiTraceFunction.Double, MultiTraceFunction.Integer, MultiTraceFunction.Long, MultiTraceFunction.Variables
Nested classes/interfaces inherited from interface microsim.statistics.LongSource
LongSource.Variables
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
protected long
protected long
protected long
protected LongSource
Fields inherited from class microsim.statistics.functions.MultiTraceFunction
count
-
Constructor Summary
ConstructorDescriptionCreates a basic statistic probe on a generic object.Long
(@NonNull LongSource source, @NonNull Enum<?> valueID) Creates a basic statistic probe on aDoubleSource
object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDoubleValue
(@NonNull Enum<?> valueID) Returns the result of a given statistic.long
getLongValue
(@NonNull Enum<?> valueID) Return the result of a given statistic.double
getMean()
The mean function.double
The variance function.void
Reads the source values and update statistics.Methods inherited from class microsim.statistics.functions.MultiTraceFunction
getCount, onEvent
-
Field Details
-
max
protected long max -
min
protected long min -
sum
protected long sum -
sumSquare
protected long sumSquare -
target
-
-
Constructor Details
-
Long
Creates a basic statistic probe on aDoubleSource
object.- Parameters:
source
- TheLongSource
object.valueID
- The value identifier defined by source object.- Throws:
NullPointerException
- when any of the input parameters isnull
.
-
Long
public Long(@NonNull @NonNull Object source, @NonNull @NonNull String valueName, boolean getFromMethod) Creates a basic statistic probe on a generic object.- Parameters:
source
- A generic source object.valueName
- The name of the field or the method returning the variable to be probed.getFromMethod
- Specifies if valueName is a method or a property value.- Throws:
NullPointerException
- when any of the input parameters isnull
.
-
-
Method Details
-
updateSource
public void updateSource()Reads the source values and update statistics.- Specified by:
updateSource
in interfaceUpdatableSource
- Overrides:
updateSource
in classMultiTraceFunction
-
getDoubleValue
Returns the result of a given statistic.- Specified by:
getDoubleValue
in interfaceDoubleSource
- Overrides:
getDoubleValue
in classMultiTraceFunction
- Parameters:
valueID
- One of theMultiTraceFunction.Variables
constants representing available statistics.- Returns:
- The computed value.
- Throws:
NullPointerException
- whenvalueID
isnull
.
-
getLongValue
Return the result of a given statistic.- Specified by:
getLongValue
in interfaceLongSource
- Parameters:
valueID
- One of theMultiTraceFunction.Variables
constants representing available statistics.- Returns:
- The computed value.
- Throws:
UnsupportedOperationException
- If the given valueID is not supported.NullPointerException
- when {valueID} isnull
.
-
getVariance
public double getVariance()The variance function.- Specified by:
getVariance
in classMultiTraceFunction
- Returns:
- The variance value.
-
getMean
public double getMean()The mean function.- Specified by:
getMean
in classMultiTraceFunction
- Returns:
- The mean value.
-