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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
boolean
Returns the current status of the time checker.void
Updates the source, invoking theupdateSource()
method.void
setCheckingTime
(boolean b) Sets the current status of the time checker.void
Forces 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:
onEvent
in interfaceEventListener
- Parameters:
type
- Accepts only theCommonEventType.UPDATE
value.- Throws:
SimulationRuntimeException
- if actionId is not equal to theCommonEventType.UPDATE
value.NullPointerException
- whentype
isnull
.
-
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:
true
if the computer is currently checking time before update cached data,false
if 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
-true
if the computer is currently checking time before update cached data,false
if disabled.
-
updateSource
public void updateSource()Forces the source to update its currently cached data.- Specified by:
updateSource
in interfaceUpdatableSource
-
applyFunction
public abstract void applyFunction()
-