Package org.cloudbus.cloudsim.power
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 PowerMeasurement()
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 PowerMeasurement
add(PowerMeasurement measurement)
Adds up the values from the given measurement and this one, returning a new instance.double
getDynamicPower()
Gets the dynamic power the entity consumes according to its load (in Watts).double
getStaticPower()
Gets the static power the entity consumes even if it's idle (in Watts).double
getTotalPower()
Gets the total power consumed by the entity (in Watts)PowerMeasurement
multiply(double factor)
Multiplies the values from this measurement by a given factor, returning a new instance.
-
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 idledynamicPower
- 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
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
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
-