Class EventBasedTally
- java.lang.Object
-
- org.djutils.stats.summarizers.Tally
-
- org.djutils.stats.summarizers.event.EventBasedTally
-
- All Implemented Interfaces:
Serializable,Remote,EventListener,EventListener,EventProducer,Statistic,TallyStatistic
public class EventBasedTally extends Tally implements EventProducer, 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-2023 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
-
Constructor Summary
Constructors Constructor Description EventBasedTally(String description)Convenience constructor that uses a NoStorageAccumulator to estimate quantiles.EventBasedTally(String description, EventProducer eventProducer)Construct a new EventBasedCounter with a specific EventProducer, e.g.EventBasedTally(String description, QuantileAccumulator quantileAccumulator)Constructs a new EventBasedTally.EventBasedTally(String description, QuantileAccumulator quantileAccumulator, EventProducer eventProducer)Construct a new EventBasedCounter with a specific EventProducer, e.g.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfireEvents()Method that can be overridden to fire own events or additional events when registering an observation.EventListenerMapgetEventListenerMap()voidinitialize()Initialize the statistic.voidnotify(Event event)doubleregister(double value)Process one observed value.StringtoString()-
Methods inherited from class org.djutils.stats.summarizers.Tally
getConfidenceInterval, getConfidenceInterval, getCumulativeProbability, getDescription, getMax, getMin, getN, getPopulationExcessKurtosis, getPopulationKurtosis, getPopulationMean, getPopulationSkewness, getPopulationStDev, getPopulationVariance, getQuantile, getSampleExcessKurtosis, getSampleKurtosis, getSampleMean, getSampleSkewness, getSampleStDev, getSampleVariance, getSum, register, reportFooter, reportHeader, reportLine
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Methods inherited from interface org.djutils.stats.summarizers.Statistic
formatFixed
-
-
-
-
Constructor Detail
-
EventBasedTally
public EventBasedTally(String description, QuantileAccumulator quantileAccumulator)
Constructs a new EventBasedTally.- Parameters:
description- String; the description of this tallyquantileAccumulator- 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, 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 countereventProducer- EventProducer; the EventProducer to embed and use in this statistic
-
EventBasedTally
public EventBasedTally(String description, QuantileAccumulator quantileAccumulator, EventProducer eventProducer)
Construct a new EventBasedCounter with a specific EventProducer, e.g. a remote one.- Parameters:
description- String; the description for this counterquantileAccumulator- QuantileAccumulator; the input series accumulator that can approximate or compute quantiles.eventProducer- EventProducer; the EventProducer to embed and use in this statistic
-
-
Method Detail
-
getEventListenerMap
public EventListenerMap getEventListenerMap() throws RemoteException
- Specified by:
getEventListenerMapin interfaceEventProducer- Throws:
RemoteException
-
initialize
public void initialize()
Initialize the statistic.- Specified by:
initializein interfaceStatistic- Overrides:
initializein classTally
-
notify
public void notify(Event event)
- Specified by:
notifyin interfaceEventListener
-
register
public double register(double value)
Process one observed value.
-
fireEvents
protected void fireEvents() throws RemoteExceptionMethod that can be overridden to fire own events or additional events when registering an observation.- Throws:
RemoteException- on network error
-
-