Class PowerModelAbstract

java.lang.Object
org.cloudbus.cloudsim.power.models.PowerModelAbstract
All Implemented Interfaces:
PowerAware, PowerModel
Direct Known Subclasses:
PowerModelSimple, PowerModelSpecPower

public abstract class PowerModelAbstract
extends java.lang.Object
implements PowerModel
An abstract implementation of a PowerModel.
Since:
CloudSim Plus 1.2.0
Author:
raysaoliveira
  • Field Summary

    Fields inherited from interface org.cloudbus.cloudsim.power.models.PowerModel

    NULL
  • Constructor Summary

    Constructors 
    Constructor Description
    PowerModelAbstract()  
  • Method Summary

    Modifier and Type Method Description
    double getEnergyLinearInterpolation​(double fromUtilization, double toUtilization, double time)
    Gets an estimation of energy consumption using linear interpolation of the utilization change for a given time interval.
    Host getHost()  
    double getPower()
    Gets the current power supply in Watts (w).
    double getPower​(double utilization)
    Gets the power supply in Watts (W), according to the utilization percentage of a critical resource, such as CPU (which is currently the only resource considered).
    protected abstract double getPowerInternal​(double utilization)
    An internal method to be implemented by sub classes to get the power supply for the current CPU utilization.
    void setHost​(Host host)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cloudbus.cloudsim.power.models.PowerAware

    getPowerInKWatts

    Methods inherited from interface org.cloudbus.cloudsim.power.models.PowerModel

    getMaxPower
  • Constructor Details

  • Method Details

    • getHost

      public Host getHost()
      Specified by:
      getHost in interface PowerModel
    • setHost

      public final void setHost​(Host host)
      Specified by:
      setHost in interface PowerModel
    • getPower

      public double getPower()
      Description copied from interface: PowerAware
      Gets the current power supply in Watts (w).
      Specified by:
      getPower in interface PowerAware
      Returns:
      the power supply in Watts (w)
      See Also:
      PowerAware.getPowerInKWatts()
    • getPower

      public final double getPower​(double utilization) throws java.lang.IllegalArgumentException
      Description copied from interface: PowerModel
      Gets the power supply in Watts (W), according to the utilization percentage of a critical resource, such as CPU (which is currently the only resource considered).
      Specified by:
      getPower in interface PowerModel
      Parameters:
      utilization - the utilization percentage (between [0 and 1]) of a resource that impacts power supply.
      Returns:
      the power supply in Watts (W)
      Throws:
      java.lang.IllegalArgumentException - when the utilization percentage is not between [0 and 1]
    • getPowerInternal

      protected abstract double getPowerInternal​(double utilization) throws java.lang.IllegalArgumentException
      An internal method to be implemented by sub classes to get the power supply for the current CPU utilization.

      The basic parameter validation is performed by the getPower(double) method.

      Parameters:
      utilization - the utilization percentage (between [0 and 1]) of a resource that is critical for power supply.
      Returns:
      the power supply for the given CPU utilization
      Throws:
      java.lang.IllegalArgumentException - when the utilization percentage is not between [0 and 1]
    • getEnergyLinearInterpolation

      public double getEnergyLinearInterpolation​(double fromUtilization, double toUtilization, double time)
      Description copied from interface: PowerModel
      Gets an estimation of energy consumption using linear interpolation of the utilization change for a given time interval. It's required to set a PowerModel in order to get power usage data.
      Specified by:
      getEnergyLinearInterpolation in interface PowerModel
      Parameters:
      fromUtilization - the initial utilization percentage
      toUtilization - the final utilization percentage
      time - the time span (in seconds) between the initial and final utilization to compute the energy consumption
      Returns:
      the estimated energy consumption in Watts-sec (Ws)