Class PowerModelHost
java.lang.Object
org.cloudbus.cloudsim.power.models.PowerModelHost
- All Implemented Interfaces:
PowerModel
- Direct Known Subclasses:
PowerModelHostSimple
,PowerModelHostSpec
Abstract implementation of a host power model.
- Since:
- CloudSim Plus 6.0.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PowerModelHost
An attribute that implements the Null Object Design Pattern forPowerModelHost
objects. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
After the Host is powered off, adds the consumed power to the total shutdown power.void
After the Host is powered on, adds the consumed power to the total startup power.getHost()
Gets the Host this PowerModel is collecting power consumption measurements from.abstract double
getPower
(double utilizationFraction) Computes the hosts power usage in Watts (W) at a certain degree of utilization.double
Get the delay (in seconds) for shutting down theHost
.double
Get the power consumed (in Watts) for shutting down theHost
.double
Get the delay (in seconds) for starting up theHost
.double
Get the power consumed (in Watts) for starting up theHost
.double
Get the total power consumed (in Watts) during all the times theHost
was powered off.double
Get the total time (in seconds) theHost
spent during shut down.double
Get the total power consumed (in Watts) during all the times theHost
was powered on.int
Gets the number of times the Host has started up.double
Get the total time (in seconds) theHost
spent during startup.protected static double
void
Sets the Host this PowerModel will collect power consumption measurements from.setShutDownDelay
(double delay) Set the delay (in seconds) for shutting down theHost
.setShutDownPower
(double power) Set the power consumed (in Watts) for shutting down theHost
.setStartupDelay
(double delay) Set the delay (in seconds) for starting up theHost
.setStartupPower
(double power) Set the power consumed (in Watts) for starting up theHost
.protected static double
validatePower
(double power, String fieldName) Checks if a power value (in Watts) is valid.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.PowerModel
getPower, getPowerMeasurement
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forPowerModelHost
objects.
-
-
Constructor Details
-
PowerModelHost
public PowerModelHost()
-
-
Method Details
-
validatePower
Checks if a power value (in Watts) is valid.- Parameters:
power
- the value to validatefieldName
- the name of the field/variable storing the value- Returns:
- the given power if it's valid
- Throws:
IllegalArgumentException
- when the value is smaller than 1
-
positive
-
getHost
Gets the Host this PowerModel is collecting power consumption measurements from.- Returns:
-
setHost
Sets the Host this PowerModel will collect power consumption measurements from.- Parameters:
host
- the Host to set
-
getPower
Computes the hosts power usage in Watts (W) at a certain degree of utilization. Mainly for backwards compatibility.- Parameters:
utilizationFraction
- the utilization percentage (between [0 and 1]) of the host.- Returns:
- the power supply in Watts (W)
- Throws:
IllegalArgumentException
- if utilizationFraction is not between [0 and 1]
-
getStartupDelay
public double getStartupDelay()Get the delay (in seconds) for starting up theHost
. -
setStartupDelay
Set the delay (in seconds) for starting up theHost
. -
getShutDownDelay
public double getShutDownDelay()Get the delay (in seconds) for shutting down theHost
. -
setShutDownDelay
Set the delay (in seconds) for shutting down theHost
. -
getStartupPower
public double getStartupPower()Get the power consumed (in Watts) for starting up theHost
. -
setStartupPower
Set the power consumed (in Watts) for starting up theHost
. -
getShutDownPower
public double getShutDownPower()Get the power consumed (in Watts) for shutting down theHost
. -
setShutDownPower
Set the power consumed (in Watts) for shutting down theHost
. -
getTotalStartupPower
public double getTotalStartupPower()Get the total power consumed (in Watts) during all the times theHost
was powered on. If the Host has never started up, returns zero. -
addStartupTotals
public void addStartupTotals()After the Host is powered on, adds the consumed power to the total startup power. If the Host is powered on/off multiple times, that power consumed is summed up. -
getTotalShutDownPower
public double getTotalShutDownPower()Get the total power consumed (in Watts) during all the times theHost
was powered off. If the Host has never started up then shutdown, returns zero. -
addShutDownTotals
public void addShutDownTotals()After the Host is powered off, adds the consumed power to the total shutdown power. If the Host is powered on/off multiple times, that power consumed is summed up. -
getTotalStartups
public int getTotalStartups()Gets the number of times the Host has started up.- Returns:
- See Also:
-
getTotalStartupTime
public double getTotalStartupTime()Get the total time (in seconds) theHost
spent during startup. If the Host starts up multiple times, the time spent is summed up.- See Also:
-
getTotalShutDownTime
public double getTotalShutDownTime()Get the total time (in seconds) theHost
spent during shut down. If the Host shuts down multiple times, the time spent is summed up.
-