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 Summary
Modifier 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
-
initialize
void initialize()Initialize the statistic. -
getDescription
String getDescription()Returns the description of the statistic.- Returns:
- the description of the statistic
-
setDescription
Set a new description of the statistic.- Parameters:
description- the new description of the statistic
-
getN
long getN()Return the current number of observations.- Returns:
- 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:
- 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- the value to formatnumberCharacters- the number of characters for the result- Returns:
- a string representation with the given number of characters
-