Class AbstractFunction

java.lang.Object
microsim.statistics.functions.AbstractFunction
All Implemented Interfaces:
EventListener, UpdatableSource
Direct Known Subclasses:
AbstractArrayFunction, AbstractWeightedArrayFunction, MaxTraceFunction, MinTraceFunction, MovingAverageTraceFunction

public abstract class AbstractFunction extends Object implements EventListener, UpdatableSource
An abstract skeleton for the statistical function able to manage update time checking.
  • Field Details

  • Constructor Details

    • AbstractFunction

      public AbstractFunction()
  • Method Details

    • onEvent

      public void onEvent(@NonNull @NonNull Enum<?> type)
      Updates the source, invoking the updateSource() method.
      Specified by:
      onEvent in interface EventListener
      Parameters:
      type - Accepts only the CommonEventType.UPDATE value.
      Throws:
      SimulationRuntimeException - if actionId is not equal to the CommonEventType.UPDATE value.
      NullPointerException - when type is null.
    • 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 interface UpdatableSource
    • applyFunction

      public abstract void applyFunction()