Class HarmonicMeanAggregator
- java.lang.Object
-
- org.palladiosimulator.monitorrepository.statisticalcharacterization.StatisticalCharacterizationAggregator
-
- org.palladiosimulator.monitorrepository.statisticalcharacterization.HarmonicMeanAggregator
-
public class HarmonicMeanAggregator extends StatisticalCharacterizationAggregator
StatisticalCharacterizationAggregator
corresponding to theHarmonicMean
model class which computes the harmonic mean of a sequence of measurements (discrete case) or a function with respect to an interval (continuous case):
In the discrete case this is simply the reciprocal of the arithmetic mean of the reciprocals of the measurements.
Note that it is not defined if any of the measurements is exactly 0. In such a case this implementation returns 0.
In the continuous case, this aggregator approximates the integral HM=(b-a) ⁄ ∫dx/f(x) wherea
andb
are upper and lower interval bound and the integration is carried out from a to b, and the (positive) functionf
is interpolated from a given (finite) set of samples (i.e., measurements).
-
-
Constructor Summary
Constructors Constructor Description HarmonicMeanAggregator(org.palladiosimulator.metricspec.NumericalBaseMetricDescription expectedWindowMetric)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.measure.Measure<Double,javax.measure.quantity.Quantity>
calculateStatisticalCharacterizationContinuous(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData)
Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a continuous scope of validity (i.e., to aggregate them).
This method is invoked withinStatisticalCharacterizationAggregator.aggregateData(Iterable, Amount, Amount, Optional)
.protected javax.measure.Measure<Double,javax.measure.quantity.Quantity>
calculateStatisticalCharaterizationDiscrete(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData)
Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a discrete scope of validity (i.e., to aggregate them).
This method is invoked withinStatisticalCharacterizationAggregator.aggregateData(Iterable, Amount, Amount, Optional)
.-
Methods inherited from class org.palladiosimulator.monitorrepository.statisticalcharacterization.StatisticalCharacterizationAggregator
aggregateData, getDataDefaultUnit, getDataMetric, getIntervalLength, obtainCurrentMeasurementValidityLength, obtainDataFromMeasurement, obtainDataValueFromMeasurement
-
-
-
-
Method Detail
-
calculateStatisticalCharaterizationDiscrete
protected javax.measure.Measure<Double,javax.measure.quantity.Quantity> calculateStatisticalCharaterizationDiscrete(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData)
Description copied from class:StatisticalCharacterizationAggregator
Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a discrete scope of validity (i.e., to aggregate them).
This method is invoked withinStatisticalCharacterizationAggregator.aggregateData(Iterable, Amount, Amount, Optional)
.- Specified by:
calculateStatisticalCharaterizationDiscrete
in classStatisticalCharacterizationAggregator
- Parameters:
windowData
- The sequence of data/measurements to be aggregated, expressed as anIterable
ofMeasuringValue
s.- Returns:
- A
Measure
representing the result of the aggregation. - See Also:
StatisticalCharacterizationAggregator.getDataMetric()
,BaseMetricDescription.getScopeOfValidity()
-
calculateStatisticalCharacterizationContinuous
protected javax.measure.Measure<Double,javax.measure.quantity.Quantity> calculateStatisticalCharacterizationContinuous(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> windowData)
Description copied from class:StatisticalCharacterizationAggregator
Method to be implemented by each subclass to calculate the statistical characterization of a sequence of measurements with a continuous scope of validity (i.e., to aggregate them).
This method is invoked withinStatisticalCharacterizationAggregator.aggregateData(Iterable, Amount, Amount, Optional)
.- Specified by:
calculateStatisticalCharacterizationContinuous
in classStatisticalCharacterizationAggregator
- Parameters:
windowData
- The sequence of data/measurements to be aggregated, expressed as anIterable
ofMeasuringValue
s.- Returns:
- A
Measure
representing the result of the aggregation. - See Also:
StatisticalCharacterizationAggregator.getDataMetric()
,BaseMetricDescription.getScopeOfValidity()
-
-