Class AbstractResourceEnvironment


  • public class AbstractResourceEnvironment
    extends Object
    Assigns strategies for resource demand simulation. Also starts calibration for active resources. Strategy is chosen by its name.
    • Field Detail

      • LOGGER

        protected static final org.apache.log4j.Logger LOGGER
      • CPU_STRATEGIES

        protected static final String[] CPU_STRATEGIES
        CPU strategies, names
      • CPU_STRATEGIES_CLASSES

        protected static final Class<?>[] CPU_STRATEGIES_CLASSES
        CPU strategies, corresponding classes
      • HDD_STRATEGIES

        protected static final String[] HDD_STRATEGIES
        HDD strategies, names
      • HDD_STRATEGIES_CLASSES

        protected static final Class<?>[] HDD_STRATEGIES_CLASSES
        HDD strategies, corresponding classes
    • Constructor Detail

      • AbstractResourceEnvironment

        public AbstractResourceEnvironment()
    • Method Detail

      • setUpCPU

        protected static void setUpCPU​(String usedStrategy,
                                       String calibrationPath,
                                       DegreeOfAccuracyEnum accuracy,
                                       String processingRate)
        Starts the CPU calibration.
        Parameters:
        usedStrategy - name of the used strategy
        calibrationPath - path where old calibration runs can be retrieved from and new ones will be stored
        accuracy - accuracy of the calibration: LOW, MEDIUM or HIGH
        processingRate - processing rate
      • setUpHDD

        protected static void setUpHDD​(String usedStrategy,
                                       String calibrationPath,
                                       DegreeOfAccuracyEnum accuracy,
                                       String processingRate)
        Starts the HDD calibration.
        Parameters:
        usedStrategy - name of the used strategy
        calibrationPath - path where old calibration runs can be retrieved from and new ones will be stored
        accuracy - accuracy of the calibration: LOW, MEDIUM or HIGH
        processingRate - processing rate
      • getCalibrationFileName

        protected static String getCalibrationFileName​(IDemandStrategy strategy,
                                                       DegreeOfAccuracyEnum accuracy,
                                                       String basePath)
        Returns the name of the file used to store the calibration table Filename depends on paramters of this class
        Returns:
        The calibration table file name
      • performDelay

        public static void performDelay​(double delay)
        Performs the "delay" resource demand. TODO: Does not really fit into this class. However, we didn't find a more suiting one.
        Parameters:
        delay - delay duration in ms