Package org.djutils.stats.summarizers
Interface Statistic
- All Known Subinterfaces:
- TallyStatistic
- All Known Implementing Classes:
- Counter,- EventBasedCounter,- EventBasedTally,- EventBasedTimestampWeightedTally,- EventBasedWeightedTally,- Tally,- TimestampWeightedTally,- WeightedTally
public interface Statistic
The Statistic interface defines the methods to implement for each of the statistics classes.
 
 Copyright (c) 2023-2025 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
- 
Method SummaryModifier and TypeMethodDescriptiondefault StringformatFixed(double value, int numberCharacters) Return a formatted string with 2 digits precision for a floating point value that fits the number of characters.Returns the description of the statistic.longgetN()Return the current number of observations.voidInitialize the statistic.Return a string representing a line with important statistics values for this statistic, for a textual table with a monospaced font that can contain multiple statistics.voidsetDescription(String description) Set a new description of the statistic.
- 
Method Details- 
initializevoid initialize()Initialize the statistic.
- 
getDescriptionString getDescription()Returns the description of the statistic.- Returns:
- the description of the statistic
 
- 
setDescriptionSet a new description of the statistic.- Parameters:
- description- the new description of the statistic
 
- 
getNlong getN()Return the current number of observations.- Returns:
- the number of observations
 
- 
reportLineString reportLine()Return a string representing a line with important statistics values for this statistic, for a textual table with a monospaced font that can contain multiple statistics.- Returns:
- line with most important values of the statistic
 
- 
formatFixedReturn a formatted string with 2 digits precision for a floating point value that fits the number of characters. The formatter will fall back to scientific notation when the value does not fit with floating point notation.- Parameters:
- value- the value to format
- numberCharacters- the number of characters for the result
- Returns:
- a string representation with the given number of characters
 
 
-