Package microsim.statistics.functions
Class MultiTraceFunction.Double
java.lang.Object
microsim.statistics.functions.MultiTraceFunction
microsim.statistics.functions.MultiTraceFunction.Double
- All Implemented Interfaces:
EventListener,DoubleSource,UpdatableSource
- Enclosing class:
MultiTraceFunction
An implementation of the Memoryless Series class, which manages double type data sources.
-
Nested Class Summary
Nested classes/interfaces inherited from class microsim.statistics.functions.MultiTraceFunction
MultiTraceFunction.Double, MultiTraceFunction.Integer, MultiTraceFunction.Long, MultiTraceFunction.VariablesNested classes/interfaces inherited from interface microsim.statistics.DoubleSource
DoubleSource.Variables -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected doubleprotected doubleprotected DoubleSourceFields inherited from class microsim.statistics.functions.MultiTraceFunction
count -
Constructor Summary
ConstructorsConstructorDescriptionCreates a basic statistic probe on a generic object.Double(@NonNull DoubleSource source, @NonNull Enum<?> valueID) Creates a basic statistic probe on aDoubleSourceobject. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDoubleValue(@NonNull Enum<?> valueID) Returns the result of a given statistic.doublegetMean()The mean function.doubleThe variance function.voidReads the source values and update statistics.Methods inherited from class microsim.statistics.functions.MultiTraceFunction
getCount, onEvent
-
Field Details
-
max
protected double max -
min
protected double min -
sum
protected double sum -
sumSquare
protected double sumSquare -
target
-
-
Constructor Details
-
Double
Creates a basic statistic probe on aDoubleSourceobject.- Parameters:
source- TheDoubleSourceobject.valueID- The value identifier defined by source object.- Throws:
NullPointerException- when any of the input parameters isnull.
-
Double
public Double(@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:
updateSourcein interfaceUpdatableSource- Overrides:
updateSourcein classMultiTraceFunction
-
getDoubleValue
Returns the result of a given statistic.- Specified by:
getDoubleValuein interfaceDoubleSource- Overrides:
getDoubleValuein classMultiTraceFunction- Parameters:
valueID- One of theMultiTraceFunction.Variablesconstants representing available statistics.- Returns:
- The computed value.
- Throws:
NullPointerException- when any of the input parameters isnull.
-
getVariance
public double getVariance()The variance function.- Specified by:
getVariancein classMultiTraceFunction- Returns:
- The variance value.
-
getMean
public double getMean()The mean function.- Specified by:
getMeanin classMultiTraceFunction- Returns:
- The mean value.
-