Package org.djutils.stats.summarizers
Interface Statistic
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
TallyStatistic
- All Known Implementing Classes:
Counter
,EventBasedCounter
,EventBasedTally
,EventBasedTimestampWeightedTally
,EventBasedWeightedTally
,Tally
,TimestampWeightedTally
,WeightedTally
The Statistic interface defines the methods to implement for each of the statistics classes.
Copyright (c) 2023-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
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
formatFixed
(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.long
getN()
Return the current number of observations.void
Initialize 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.
-
Method Details
-
initialize
void initialize()Initialize the statistic. -
getDescription
String getDescription()Returns the description of the statistic.- Returns:
- String; the description of the statistic
-
getN
long getN()Return the current number of observations.- Returns:
- long; the number of observations
-
reportLine
String 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:
- String; line with most important values of the statistic
-
formatFixed
Return 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
- double; the value to formatnumberCharacters
- int; the number of characters for the result- Returns:
- String; a string representation with the given number of characters
-