Class PowerMeasurement

java.lang.Object
org.cloudbus.cloudsim.power.PowerMeasurement

public class PowerMeasurement extends Object
Power consumption measurement produced by a PowerModel, consisting of a static and a dynamic fraction (in Watts). This measurement is performed on the entity the PowerModel is assigned to.

This is an immutable class providing operations such as add(PowerMeasurement) and multiply(double) that returns a new instance.

Since:
CloudSim Plus 6.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a power measurement with zero static and dynamic power consumption.
    PowerMeasurement(double staticPower, double dynamicPower)
    Instantiates a power measurement with a given static and dynamic power consumption.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(PowerMeasurement measurement)
    Adds up the values from the given measurement and this one, returning a new instance.
    double
    Gets the dynamic power the entity consumes according to its load (in Watts).
    double
    Gets the static power the entity consumes even if it's idle (in Watts).
    double
    Gets the total power consumed by the entity (in Watts)
    multiply(double factor)
    Multiplies the values from this measurement by a given factor, returning a new instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PowerMeasurement

      public PowerMeasurement(double staticPower, double dynamicPower)
      Instantiates a power measurement with a given static and dynamic power consumption.
      Parameters:
      staticPower - power (in watts) the entity consumes when idle
      dynamicPower - power (in watts) the entity consumes according to its load
    • PowerMeasurement

      public PowerMeasurement()
      Instantiates a power measurement with zero static and dynamic power consumption.
  • Method Details

    • getTotalPower

      public double getTotalPower()
      Gets the total power consumed by the entity (in Watts)
      Returns:
    • getStaticPower

      public double getStaticPower()
      Gets the static power the entity consumes even if it's idle (in Watts).
      Returns:
    • getDynamicPower

      public double getDynamicPower()
      Gets the dynamic power the entity consumes according to its load (in Watts).
      Returns:
    • add

      public PowerMeasurement add(PowerMeasurement measurement)
      Adds up the values from the given measurement and this one, returning a new instance.
      Parameters:
      measurement - another measurement to add its values with this instance
      Returns:
      the new instance with the added up values
    • multiply

      public PowerMeasurement multiply(double factor)
      Multiplies the values from this measurement by a given factor, returning a new instance.
      Parameters:
      factor - the factor to multiply the values of this measurement
      Returns:
      the new instance with the multiplied values