Class AbstractEvaluationScope

  • All Implemented Interfaces:
    Iterable<Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Map<org.palladiosimulator.metricspec.MetricDescription,​org.palladiosimulator.measurementframework.MeasuringValue>>>
    Direct Known Subclasses:
    EvaluationScope

    public abstract class AbstractEvaluationScope
    extends Object
    implements Iterable<Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Map<org.palladiosimulator.metricspec.MetricDescription,​org.palladiosimulator.measurementframework.MeasuringValue>>>
    This class provides basic functionality for all classes that wish to provide a scope to evaluate the power/energy consumption of resources.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected EvaluationScopeIterator iterator  
      protected Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Set<org.palladiosimulator.edp2.datastream.IDataStream<org.palladiosimulator.measurementframework.MeasuringValue>>> resourceMeasurements  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      javax.measure.Measure<Double,​javax.measure.quantity.Duration> getCurrentPointInTime()  
      Collection<org.palladiosimulator.measurementframework.MeasuringValue> getMeasurements​(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification processingResourceSpecification)
      Gets the current set of measurements that are evaluated for a specific resource.
      Iterator<org.palladiosimulator.measurementframework.MeasuringValue> getMeasurementsForProcessingResource​(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification processingResourceSpecification, org.palladiosimulator.metricspec.MetricDescription metric)
      This methods provides access to all the MeasuringValues of a certain ProcessingResourceSpecification for a certain MetricDescription.
      boolean hasNext()
      Return true if the evaluation scope can move forward in a timely fashion.
      EvaluationScopeIterator iterator()  
      void next()
      Moves on to the next set of context elements.
      void reset()
      Resets the scope to its initial state.
      In particular, the currently available set of measurements is discarded.
      abstract void setResourceMetricsToEvaluate​(Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Set<org.palladiosimulator.metricspec.MetricDescription>> metricsMap)
      Sets for each ProcessingResourceSpecification which metrics are supposed to be evaluated.
    • Field Detail

      • resourceMeasurements

        protected final Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Set<org.palladiosimulator.edp2.datastream.IDataStream<org.palladiosimulator.measurementframework.MeasuringValue>>> resourceMeasurements
    • Constructor Detail

      • AbstractEvaluationScope

        protected AbstractEvaluationScope()
        Initializes a new instance of the AbstractEvaluationScope class.
    • Method Detail

      • setResourceMetricsToEvaluate

        public abstract void setResourceMetricsToEvaluate​(Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Set<org.palladiosimulator.metricspec.MetricDescription>> metricsMap)
        Sets for each ProcessingResourceSpecification which metrics are supposed to be evaluated. The method is to be provided by implementing subclasses.
        A call to this method results in initializing the resourceMeasurements used to when iterating the scope. If for a certain ProcessingResourceSpecification and MetricDescription there are no measurements available or there is no way to create the measurements from the available data, an IllegalArgumentException is thrown.
        Parameters:
        metricsMap - the Map linking ProcessingResourceSpecifications to the metrics needed by the AbstractResourcePowerModelCalculator in use.
      • reset

        public void reset()
        Resets the scope to its initial state.
        In particular, the currently available set of measurements is discarded.
        See Also:
        next()
      • hasNext

        public final boolean hasNext()
        Return true if the evaluation scope can move forward in a timely fashion. That is basically the case if there is at least one datastream that contains additional measurements.
        Returns:
        true, if scope can move forward.
      • next

        public final void next()
        Moves on to the next set of context elements. Specifically, this moves the underlying utilization sliding window forward and evaluates the utilization to the next point in time for which we want to evaluate the power consumption.
        See Also:
        reset()
      • getCurrentPointInTime

        public javax.measure.Measure<Double,​javax.measure.quantity.Duration> getCurrentPointInTime()
      • getMeasurementsForProcessingResource

        public final Iterator<org.palladiosimulator.measurementframework.MeasuringValue> getMeasurementsForProcessingResource​(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification processingResourceSpecification,
                                                                                                                              org.palladiosimulator.metricspec.MetricDescription metric)
        This methods provides access to all the MeasuringValues of a certain ProcessingResourceSpecification for a certain MetricDescription.
        Parameters:
        processingResourceSpecification - The ProcessingResourceSpecification to retrieve the measurements for.
        metric - The MetricDescription which characterizes the measurements to collect.
        Returns:
        An Iterator that contains all the measurements this scope evaluated for the given processing resource. If no measurements are available for the resource or for the specified metric, the method returns an empty iterator.
      • getMeasurements

        public final Collection<org.palladiosimulator.measurementframework.MeasuringValue> getMeasurements​(org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification processingResourceSpecification)
        Gets the current set of measurements that are evaluated for a specific resource.
        Parameters:
        processingResourceSpecification - The resource for which the utilization is retrieved.
        Returns:
        An UNMODIFIABLE collection consisting of the utilization measurements for the requested resource for the current scope state, or an empty collection if no measurements are present.
      • iterator

        public EvaluationScopeIterator iterator()
        Specified by:
        iterator in interface Iterable<Map<org.palladiosimulator.pcm.resourceenvironment.ProcessingResourceSpecification,​Map<org.palladiosimulator.metricspec.MetricDescription,​org.palladiosimulator.measurementframework.MeasuringValue>>>