Package microsim.statistics.functions
Class AbstractFunction
java.lang.Object
microsim.statistics.functions.AbstractFunction
- All Implemented Interfaces:
EventListener,UpdatableSource
- Direct Known Subclasses:
AbstractArrayFunction,AbstractWeightedArrayFunction,MaxTraceFunction,MinTraceFunction,MovingAverageTraceFunction
An abstract skeleton for the statistical function able to manage update time checking.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbooleanReturns the current status of the time checker.voidUpdates the source, invoking theupdateSource()method.voidsetCheckingTime(boolean b) Sets the current status of the time checker.voidForces the source to update its currently cached data.
-
Field Details
-
timeChecker
-
-
Constructor Details
-
AbstractFunction
public AbstractFunction()
-
-
Method Details
-
onEvent
Updates the source, invoking theupdateSource()method.- Specified by:
onEventin interfaceEventListener- Parameters:
type- Accepts only theCommonEventType.UPDATEvalue.- Throws:
SimulationRuntimeException- if actionId is not equal to theCommonEventType.UPDATEvalue.NullPointerException- whentypeisnull.
-
isCheckingTime
public boolean isCheckingTime()Returns the current status of the time checker. A time checker avoid the object to update more than one time per simulation step. The default value is enabled (true).- Returns:
trueif the computer is currently checking time before update cached data,falseif disabled.
-
setCheckingTime
public void setCheckingTime(boolean b) Sets the current status of the time checker. A time checker avoid the object to update more than one time per simulation step. The default value is enabled (true).- Parameters:
b-trueif the computer is currently checking time before update cached data,falseif disabled.
-
updateSource
public void updateSource()Forces the source to update its currently cached data.- Specified by:
updateSourcein interfaceUpdatableSource
-
applyFunction
public abstract void applyFunction()
-