Interface UtilizationModel

All Known Implementing Classes:
UtilizationModelAbstract, UtilizationModelDynamic, UtilizationModelFull, UtilizationModelPlanetLab, UtilizationModelStochastic

public interface UtilizationModel
An interface to be implemented in order to provide a fine-grained control over resource usage by a Cloudlet. It also implements the Null Object Design Pattern in order to start avoiding NullPointerException when using the NULL object instead of attributing null to UtilizationModel variables.
Since:
CloudSim Toolkit 2.0
Author:
Anton Beloglazov, Manoel Campos da Silva Filho
  • Field Details

    • NULL

      static final UtilizationModel NULL
      An attribute that implements the Null Object Design Pattern for UtilizationModel objects using a Lambda Expression. A Cloudlet using such a utilization model for one of its resources will not consume any amount of that resource ever.
  • Method Details

    • getSimulation

      Simulation getSimulation()
      Gets the simulation that this UtilizationModel belongs to.
      Returns:
    • getUnit

      Gets the UtilizationModel.Unit in which the resource utilization is defined.
      Returns:
    • setSimulation

      UtilizationModel setSimulation(Simulation simulation)
      Sets the simulation that this UtilizationModel belongs to.
      Parameters:
      simulation - the Simulation instance to set
      Returns:
    • getUtilization

      double getUtilization(double time)
      Gets the expected utilization of resource at a given simulation time. Such a value can be a percentage in scale from 0..1 or an absolute value, depending on the getUnit().

      It is an expected usage value because the actual Cloudlet resource usage depends on the available Vm resource.

      Parameters:
      time - the time to get the resource usage.
      Returns:
      the resource utilization at the given time
      See Also:
    • getUtilization

      double getUtilization()
      Gets the expected utilization of resource at the current simulation time. Such a value can be a percentage in scale from 0..1 or an absolute value, depending on the getUnit().

      It is an expected usage value because the actual Cloudlet resource usage depends on the available Vm resource.

      Returns:
      the current resource utilization
      See Also:
    • isOverCapacityRequestAllowed

      boolean isOverCapacityRequestAllowed()
      Checks if the resource utilization requested by a Cloudlet is allowed to exceed 100% or not.

      WARNING: This attribute is just considered when the getUnit() is defined as UtilizationModel.Unit.PERCENTAGE.

      Returns:
      true if Cloudlets can request more than 100% of a resource, false otherwise
      See Also:
    • setOverCapacityRequestAllowed

      UtilizationModel setOverCapacityRequestAllowed(boolean allow)
      Allow the resource utilization requested by a Cloudlet to exceed 100% or not.

      The VM's CloudletScheduler won't allocate more resources than there is available, showing a warning if such a request is received. While requesting more than 100% of a resource may be useful to try simulating an overloading scenario, in other ones it may not be desired. You may want your Cloudlets to request the maximum of 100% of a given resource. In such a case, you can disable this attribute and the getUtilization(double) method will only return values strictly between the closed range [0..1]. If a value greater than 1 is generated, it's returned 1.

      For specific implementations such as the UtilizationModelPlanetLab (which reads data from a trace file that may be manipulated) and UtilizationModelStochastic (which generates utilization values randomly), the model may return values greater than 1 (100%). In such cases, you may consider disabling this attribute if you don't want such a behaviour.

      WARNING: This attribute is just considered when the getUnit() is defined as UtilizationModel.Unit.PERCENTAGE.

      Parameters:
      allow - true to allow requesting more than 100% of a resource, false to disallow that
      Returns: