Package microsim.statistics.functions
Class MinTraceFunction
java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.functions.MinTraceFunction
- All Implemented Interfaces:
EventListener,DoubleSource,UpdatableSource
- Direct Known Subclasses:
MinTraceFunction.Double,MinTraceFunction.Integer,MinTraceFunction.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
Nested ClassesModifier and TypeClassDescriptionstatic classAn implementation of the Memoryless Series class, which manages double type data sources.static classAn implementation of the Memoryless Series class, which manages integer type data sources.static classAn implementation of the Memoryless Series class, which manages long type data sources.static enum -
Field Summary
FieldsFields inherited from class microsim.statistics.functions.AbstractFunction
timeChecker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIncrements the total count.voidEventListenercallback function.Methods inherited from class microsim.statistics.functions.AbstractFunction
isCheckingTime, setCheckingTime, updateSourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface microsim.statistics.DoubleSource
getDoubleValue
-
Field Details
-
count
protected int count
-
-
Constructor Details
-
MinTraceFunction
public MinTraceFunction()
-
-
Method Details
-
applyFunction
public void applyFunction()Increments the total count.- Specified by:
applyFunctionin classAbstractFunction
-
onEvent
EventListenercallback function. It supports onlyCommonEventType.UPDATEevent.- Specified by:
onEventin interfaceEventListener- Overrides:
onEventin classAbstractFunction- Parameters:
type- The action id. OnlyCommonEventType.UPDATEis supported.- Throws:
SimulationRuntimeException- If actionType is not supported.NullPointerException- whentypeisnull.
-