Class PowerModelHostAbstract

java.lang.Object
org.cloudsimplus.power.models.PowerModelHostAbstract
All Implemented Interfaces:
PowerModel, PowerModelHost
Direct Known Subclasses:
PowerModelHostSimple, PowerModelHostSpec

public abstract class PowerModelHostAbstract extends Object implements PowerModelHost
Abstract implementation of a Host PowerModel.
Since:
CloudSim Plus 6.0.0
See Also:
  • Constructor Details

    • PowerModelHostAbstract

      public PowerModelHostAbstract()
  • Method Details

    • validatePower

      protected static double validatePower(double power, String fieldName)
      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: PowerModelHost
      Computes the hosts power usage in Watts (W) at a certain degree of utilization. Mainly for backwards compatibility.
      Specified by:
      getPower in interface PowerModelHost
      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

      public PowerModelHost setStartupPower(double power)
      Description copied from interface: PowerModelHost
      Set the power consumed (in Watts) for starting up the Host.
      Specified by:
      setStartupPower in interface PowerModelHost
    • setShutDownPower

      public PowerModelHost setShutDownPower(double power)
      Description copied from interface: PowerModelHost
      Set the power consumed (in Watts) for shutting down the Host.
      Specified by:
      setShutDownPower in interface PowerModelHost
    • addStartupTotals

      public void addStartupTotals()
      Description copied from interface: PowerModelHost
      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.
      Specified by:
      addStartupTotals in interface PowerModelHost
    • addShutDownTotals

      public void addShutDownTotals()
      Description copied from interface: PowerModelHost
      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.
      Specified by:
      addShutDownTotals in interface PowerModelHost