Class StatisticalCharacterizationAggregator

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      org.palladiosimulator.measurementframework.MeasuringValue aggregateData​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> data, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalLeftBound, org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalRightBound, Optional<org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>> intervalLength)
      Method to be called by clients that wish to aggregate a sequence of data.
      protected abstract javax.measure.Measure<Double,​javax.measure.quantity.Quantity> calculateStatisticalCharacterizationContinuous​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
      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 within aggregateData(Iterable, Amount, Amount, Optional).
      protected abstract javax.measure.Measure<Double,​javax.measure.quantity.Quantity> calculateStatisticalCharaterizationDiscrete​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
      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 within aggregateData(Iterable, Amount, Amount, Optional).
      javax.measure.unit.Unit<javax.measure.quantity.Quantity> getDataDefaultUnit()
      Gets the default unit of the aggregated data.
      org.palladiosimulator.metricspec.NumericalBaseMetricDescription getDataMetric()
      Gets the data metric of the measurements this instance is aggregating.
      protected org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getIntervalLength()
      Gets the length of the interval that the data to aggregate lie in.
      protected org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainCurrentMeasurementValidityLength​(org.palladiosimulator.measurementframework.MeasuringValue currentMeasurement, Optional<org.palladiosimulator.measurementframework.MeasuringValue> nextMeasurement)
      Gets how "long" the value of a certain measurement (with a continuous scope of validity) is valid which is the difference between the point in time the next measurement was taken and that of the given measurement (or the left bound of the current interval if the latter is "larger").
      In case no succeeding measurement is present, the right bound of the interval all data lie in is used instead.
      protected org.jscience.physics.amount.Amount<javax.measure.quantity.Quantity> obtainDataFromMeasurement​(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
      protected double obtainDataValueFromMeasurement​(org.palladiosimulator.measurementframework.MeasuringValue measurement)
      Gets the numeric value of desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
    • Constructor Detail

      • StatisticalCharacterizationAggregator

        public StatisticalCharacterizationAggregator​(org.palladiosimulator.metricspec.NumericalBaseMetricDescription expectedDataMetric)
        Initializes a new instance of the StatisticalCharacterizationAggregator class with the given parameter.
        Parameters:
        expectedDataMetric - The NumericalBaseMetricDescription that describes which kind of measurements are expected to aggregate.
        Throws:
        NullPointerException - In case expectedWindowMetric == null.
    • Method Detail

      • getDataMetric

        public org.palladiosimulator.metricspec.NumericalBaseMetricDescription getDataMetric()
        Gets the data metric of the measurements this instance is aggregating.
        Returns:
        The NumericalBaseMetricDescription representing the underlying metric of the data.
        See Also:
        getDataDefaultUnit()
      • getDataDefaultUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Quantity> getDataDefaultUnit()
        Gets the default unit of the aggregated data.
        Returns:
        The default unit of the aggregated data, expressed as a Unit object.
        See Also:
        NumericalBaseMetricDescription.getDefaultUnit(), getDataMetric()
      • aggregateData

        public final org.palladiosimulator.measurementframework.MeasuringValue aggregateData​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> data,
                                                                                             org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalLeftBound,
                                                                                             org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> intervalRightBound,
                                                                                             Optional<org.jscience.physics.amount.Amount<javax.measure.quantity.Duration>> intervalLength)
        Method to be called by clients that wish to aggregate a sequence of data.
        Parameters:
        data - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
        intervalLeftBound - The left bound of the interval all measurements lie in, expressed in terms of a Duration Amount.
        In the common case this parameter is only used for measurements with a continuous ScopeOfValidity data metric.
        intervalRightBound - The right bound of the interval all measurements lie in, expressed in terms of a Duration Amount.
        In the common case this parameter is only used for measurements with a continuous ScopeOfValidity data metric.
        intervalLength - A potentially empty Optional indicating the interval length.
        If empty, the length is computed from the passed interval bounds.
        Returns:
        A MeasuringValue representing the result of the aggregation.
        Throws:
        NullPointerException - If any of the parameters is null.
        IllegalArgumentException - If any of the given Amounts represents a negative value.
        See Also:
        getDataMetric()
      • getIntervalLength

        protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> getIntervalLength()
        Gets the length of the interval that the data to aggregate lie in.
        Returns:
        An Amount indicating the interval length.
      • obtainDataFromMeasurement

        protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Quantity> obtainDataFromMeasurement​(org.palladiosimulator.measurementframework.MeasuringValue measurement)
        Gets the desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
        Parameters:
        measurement - A MeasuringValue containing the data.
        Returns:
        The desired data, expressed in terms of an Amount.
        See Also:
        obtainDataValueFromMeasurement(MeasuringValue), NumericalBaseMetricDescription.getDefaultUnit()
      • obtainDataValueFromMeasurement

        protected final double obtainDataValueFromMeasurement​(org.palladiosimulator.measurementframework.MeasuringValue measurement)
        Gets the numeric value of desired data (i.e., the data that adheres to the expected data metric) from the given measurement.
        Parameters:
        measurement - A MeasuringValue containing the data.
        Returns:
        The desired data value, expressed in terms of a double value in the default unit of the corresponding metric.
        See Also:
        NumericalBaseMetricDescription.getDefaultUnit(), obtainDataFromMeasurement(MeasuringValue)
      • calculateStatisticalCharaterizationDiscrete

        protected abstract javax.measure.Measure<Double,​javax.measure.quantity.Quantity> calculateStatisticalCharaterizationDiscrete​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
        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 within aggregateData(Iterable, Amount, Amount, Optional).
        Parameters:
        dataToAggregate - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
        Returns:
        A Measure representing the result of the aggregation.
        See Also:
        getDataMetric(), BaseMetricDescription.getScopeOfValidity()
      • calculateStatisticalCharacterizationContinuous

        protected abstract javax.measure.Measure<Double,​javax.measure.quantity.Quantity> calculateStatisticalCharacterizationContinuous​(Iterable<org.palladiosimulator.measurementframework.MeasuringValue> dataToAggregate)
        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 within aggregateData(Iterable, Amount, Amount, Optional).
        Parameters:
        dataToAggregate - The sequence of data/measurements to be aggregated, expressed as an Iterable of MeasuringValues.
        Returns:
        A Measure representing the result of the aggregation.
        See Also:
        getDataMetric(), BaseMetricDescription.getScopeOfValidity()
      • obtainCurrentMeasurementValidityLength

        protected final org.jscience.physics.amount.Amount<javax.measure.quantity.Duration> obtainCurrentMeasurementValidityLength​(org.palladiosimulator.measurementframework.MeasuringValue currentMeasurement,
                                                                                                                                   Optional<org.palladiosimulator.measurementframework.MeasuringValue> nextMeasurement)
        Gets how "long" the value of a certain measurement (with a continuous scope of validity) is valid which is the difference between the point in time the next measurement was taken and that of the given measurement (or the left bound of the current interval if the latter is "larger").
        In case no succeeding measurement is present, the right bound of the interval all data lie in is used instead.
        Parameters:
        currentMeasurement - The MeasuringValue whose validity "length" is to be determined.
        nextMeasurement - An Optional containing the directly succeeding MeasuringValue, or an empty Optional in case none is at hand.
        Returns:
        The validity "length" of the measurement, expressed in terms of a Duration Amount.
        Throws:
        IllegalStateException - If the ScopeOfValidity of the underlying metric is not ScopeOfValidity.CONTINUOUS.
        See Also:
        aggregateData(Iterable, Amount, Amount, Optional), getDataMetric(), BaseMetricDescription.getScopeOfValidity()