Class PowerModelHostAbstract
java.lang.Object
org.cloudsimplus.power.models.PowerModelHostAbstract
- All Implemented Interfaces:
PowerModel,PowerModelHost
- Direct Known Subclasses:
PowerModelHostSimple,PowerModelHostSpec
Abstract implementation of a
Host PowerModel.- Since:
- CloudSim Plus 6.0.0
- See Also:
-
Field Summary
Fields inherited from interface org.cloudsimplus.power.models.PowerModelHost
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAfter the Host is powered off, adds the consumed power to the total shutdown power.voidAfter the Host is powered on, adds the consumed power to the total startup power.final doublegetPower(double utilizationFraction) Computes the hosts power usage in Watts (W) at a certain degree of utilization.protected abstract doublegetPowerInternal(double utilizationFraction) setShutDownPower(double power) Set the power consumed (in Watts) for shutting down theHost.setStartupPower(double power) Set the power consumed (in Watts) for starting up theHost.protected static doublevalidatePower(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, waitMethods inherited from interface org.cloudsimplus.power.models.PowerModel
getPower, getPowerMeasurementMethods inherited from interface org.cloudsimplus.power.models.PowerModelHost
getHost, getShutDownPower, getStartupPower, getTotalShutDownPower, getTotalShutDownTime, getTotalStartupPower, getTotalStartups, getTotalStartupTime, setHost
-
Constructor Details
-
PowerModelHostAbstract
public PowerModelHostAbstract()
-
-
Method Details
-
validatePower
Checks if a power value (in Watts) is valid.- Parameters:
power- the value to validate (in Watts)fieldName- 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
-
getPower
public final double getPower(double utilizationFraction) Description copied from interface:PowerModelHostComputes the hosts power usage in Watts (W) at a certain degree of utilization. Mainly for backwards compatibility.- Specified by:
getPowerin interfacePowerModelHost- Parameters:
utilizationFraction- the utilization percentage (between [0 and 1]) of the host.- Returns:
- the power supply in Watts (W)
-
getPowerInternal
protected abstract double getPowerInternal(double utilizationFraction) - See Also:
-
setStartupPower
Description copied from interface:PowerModelHostSet the power consumed (in Watts) for starting up theHost.- Specified by:
setStartupPowerin interfacePowerModelHost
-
setShutDownPower
Description copied from interface:PowerModelHostSet the power consumed (in Watts) for shutting down theHost.- Specified by:
setShutDownPowerin interfacePowerModelHost
-
addStartupTotals
public void addStartupTotals()Description copied from interface:PowerModelHostAfter 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.- Specified by:
addStartupTotalsin interfacePowerModelHost
-
addShutDownTotals
public void addShutDownTotals()Description copied from interface:PowerModelHostAfter 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.- Specified by:
addShutDownTotalsin interfacePowerModelHost
-