Package microsim.statistics.functions
Class MaxTraceFunction
java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.functions.MaxTraceFunction
- All Implemented Interfaces:
EventListener
,DoubleSource
,UpdatableSource
- Direct Known Subclasses:
MaxTraceFunction.Double
,MaxTraceFunction.Integer
,MaxTraceFunction.Long
A MixFunction object is to collect data over time, computing some statistics on the fly, without storing the data in
memory. It is particularly useful when the user need to compute basic statistics on data sources, without affecting
the memory occupancy. The memoryless series computes automatically the statistics using accumulation variables and
counters.
This statistic computer should be used when possible, particularly when the simulation model has to run for a long time, condition which implies the growth of the memory occupancy. Moreover, the Memoryless Series objects are much faster than the Series one, because they pre-compute the statistics operation step by step. Trying to compute a mean of a Series object, force the Mean function to sum all the values, every time series is updated.
This statistic computer should be used when possible, particularly when the simulation model has to run for a long time, condition which implies the growth of the memory occupancy. Moreover, the Memoryless Series objects are much faster than the Series one, because they pre-compute the statistics operation step by step. Trying to compute a mean of a Series object, force the Mean function to sum all the values, every time series is updated.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An implementation of the Memoryless Series class, which manages double type data sources.static class
An implementation of the Memoryless Series class, which manages integer type data sources.static class
An implementation of the Memoryless Series class, which manages long type data sources.static enum
-
Field Summary
Fields inherited from class microsim.statistics.functions.AbstractFunction
timeChecker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Collects a value from the source.void
EventListener
callback function.Methods inherited from class microsim.statistics.functions.AbstractFunction
isCheckingTime, setCheckingTime, updateSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface microsim.statistics.DoubleSource
getDoubleValue
-
Field Details
-
count
protected int count
-
-
Constructor Details
-
MaxTraceFunction
public MaxTraceFunction()
-
-
Method Details
-
applyFunction
public void applyFunction()Collects a value from the source.- Specified by:
applyFunction
in classAbstractFunction
-
onEvent
EventListener
callback function. It supports onlyCommonEventType.UPDATE
event.- Specified by:
onEvent
in interfaceEventListener
- Overrides:
onEvent
in classAbstractFunction
- Parameters:
type
- The action id. OnlyCommonEventType.UPDATE
is supported.- Throws:
SimulationRuntimeException
- If actionType is not supported.NullPointerException
- whentype
isnull
.
-