Class PowerModelHost

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

public abstract class PowerModelHost extends Object implements PowerModel
Abstract implementation of a host power model.
Since:
CloudSim Plus 6.0.0
See Also:
  • Field Details

  • Constructor Details

    • PowerModelHost

      public PowerModelHost()
  • 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
      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
    • positive

      protected static double positive(double value, String fieldName)
    • getHost

      public Host getHost()
      Gets the Host this PowerModel is collecting power consumption measurements from.
      Returns:
    • setHost

      public void setHost(Host host)
      Sets the Host this PowerModel will collect power consumption measurements from.
      Parameters:
      host - the Host to set
    • getPower

      public abstract double getPower(double utilizationFraction) throws IllegalArgumentException
      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 the Host.
    • setStartupDelay

      public PowerModelHost setStartupDelay(double delay)
      Set the delay (in seconds) for starting up the Host.
    • getShutDownDelay

      public double getShutDownDelay()
      Get the delay (in seconds) for shutting down the Host.
    • setShutDownDelay

      public PowerModelHost setShutDownDelay(double delay)
      Set the delay (in seconds) for shutting down the Host.
    • getStartupPower

      public double getStartupPower()
      Get the power consumed (in Watts) for starting up the Host.
    • setStartupPower

      public PowerModelHost setStartupPower(double power)
      Set the power consumed (in Watts) for starting up the Host.
    • getShutDownPower

      public double getShutDownPower()
      Get the power consumed (in Watts) for shutting down the Host.
    • setShutDownPower

      public PowerModelHost setShutDownPower(double power)
      Set the power consumed (in Watts) for shutting down the Host.
    • getTotalStartupPower

      public double getTotalStartupPower()
      Get the total power consumed (in Watts) during all the times the Host 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 the Host 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) the Host 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) the Host spent during shut down. If the Host shuts down multiple times, the time spent is summed up.