IRockyStatisticsAdder is an auxiliary struct used to calculate the mean, standard deviation, skewness and kurtosis of a set of values. Rocky uses it in the collision statistics modules for calculating statistics of sets of collision values associated to specific entities. However, it could be used to calculate the statistics of any set of values generated during a simulation. The mean and the statistical moments up to fourth order are calculated using a one-pass algorithm, therefore, their values are updated internally every time a new value is added to the set with the add_value method.
For the mathematical definitions of the statistics calculated by this struct, please refer to the DEM Technical Manual.
Inherits from:
- rocky20::AAdder
Members
Public functions
Function add_value
IRockyStatisticsAdder must calculate statistics.
Parameters:
- new_value: A new value that belong to the set.
- n_values: The number of values of the set, including the one added by this method. A companion
IRockyStatisticsCounterobject can be used to keep track of that number.
- double new_value
Function get_mean
add_value method up to the point where this method is called.
Return type: double
Function get_std_deviation
add_value method up to the point where this method is called.
Return type: double
Function get_skewness
add_value method up to the point where this method is called. The skewness is defined in the DEM Technical Manual.
Return type: double
Function get_kurtosis
add_value method up to the point where this method is called. The kurtosis is defined in the DEM Technical Manual.
Return type: double
Function reset
Function join
IRockyStatisticsAdder. After executing this method, the statistics for the compound set will be available through the methods get_mean, get_std_deviation, etc.
Parameters:
- other: The instance of
IRockyStatisticsAdderthat calculated the statistics of the second set of values.
- const IRockyStatisticsAdder & other