Class EventBasedTally

java.lang.Object
org.djutils.stats.summarizers.Tally
org.djutils.stats.summarizers.event.EventBasedTally
All Implemented Interfaces:
Serializable, Remote, EventListener, org.djutils.event.EventListener, org.djutils.event.EventProducer, Statistic, TallyStatistic

public class EventBasedTally extends Tally implements org.djutils.event.EventProducer, org.djutils.event.EventListener
The EventBasedTally class registers a series of values and provides mean, standard deviation, etc. of the registered values. It embeds an EventProducer so it can keep listeners informed about new observations, and it listens to external events to be able to receive observations, in addition to the register(...) method.

Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://simulation.tudelft.nl/dsol/3.0/license.html.

Author:
Alexander Verbraeck, Peter Jacobs , Peter Knoppers
See Also:
  • Constructor Details

    • EventBasedTally

      public EventBasedTally(String description, QuantileAccumulator quantileAccumulator)
      Constructs a new EventBasedTally.
      Parameters:
      description - String; the description of this tally
      quantileAccumulator - QuantileAccumulator; the input series accumulator that can approximate or compute quantiles.
    • EventBasedTally

      public EventBasedTally(String description)
      Convenience constructor that uses a NoStorageAccumulator to estimate quantiles.
      Parameters:
      description - String; the description of this tally
    • EventBasedTally

      public EventBasedTally(String description, org.djutils.event.EventProducer eventProducer)
      Construct a new EventBasedCounter with a specific EventProducer, e.g. a remote one. The Tally uses uses a NoStorageAccumulator to estimate quantiles.
      Parameters:
      description - String; the description for this counter
      eventProducer - EventProducer; the EventProducer to embed and use in this statistic
    • EventBasedTally

      public EventBasedTally(String description, QuantileAccumulator quantileAccumulator, org.djutils.event.EventProducer eventProducer)
      Construct a new EventBasedCounter with a specific EventProducer, e.g. a remote one.
      Parameters:
      description - String; the description for this counter
      quantileAccumulator - QuantileAccumulator; the input series accumulator that can approximate or compute quantiles.
      eventProducer - EventProducer; the EventProducer to embed and use in this statistic
  • Method Details

    • getEventListenerMap

      public org.djutils.event.EventListenerMap getEventListenerMap() throws RemoteException
      Specified by:
      getEventListenerMap in interface org.djutils.event.EventProducer
      Throws:
      RemoteException
    • initialize

      public void initialize()
      Description copied from interface: Statistic
      Initialize the statistic.
      Specified by:
      initialize in interface Statistic
      Overrides:
      initialize in class Tally
    • notify

      public void notify(org.djutils.event.Event event)
      Specified by:
      notify in interface org.djutils.event.EventListener
    • register

      public double register(double value)
      Description copied from class: Tally
      Process one observed value.
      Overrides:
      register in class Tally
      Parameters:
      value - double; the value to process
      Returns:
      double; the value
    • fireEvents

      protected void fireEvents() throws RemoteException
      Method that can be overridden to fire own events or additional events when registering an observation.
      Throws:
      RemoteException - on network error
    • toString

      public String toString()
      Overrides:
      toString in class Tally