Class PowerMeasurement

java.lang.Object
org.cloudsimplus.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 that the PowerModel assigned to.

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

Since:
CloudSim Plus 6.0.0
  • Constructor Details

    • PowerMeasurement

      public PowerMeasurement(double staticPower, double dynamicPower)
      Instantiates a power measurement with 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 CPU load
    • PowerMeasurement

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

    • getTotalPower

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

      public PowerMeasurement add(@NonNull @NonNull 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