Class UtilizationModelAbstract

java.lang.Object
org.cloudsimplus.utilizationmodels.UtilizationModelAbstract
All Implemented Interfaces:
UtilizationModel
Direct Known Subclasses:
UtilizationModelDynamic, UtilizationModelFull, UtilizationModelPlanetLab, UtilizationModelStochastic

public abstract class UtilizationModelAbstract extends Object implements UtilizationModel
An abstract class to implement UtilizationModels.
Since:
CloudSim Plus 1.2
Author:
Manoel Campos da Silva Filho
  • Field Details

    • ALMOST_ZERO

      public static final double ALMOST_ZERO
      Indicates that values lower or equal to this will be considered as zero. This constant is used to compare utilization values to avoid floating point precision issues.
      See Also:
  • Constructor Details

    • UtilizationModelAbstract

      public UtilizationModelAbstract()
    • UtilizationModelAbstract

      public UtilizationModelAbstract(@NonNull @NonNull UtilizationModel.Unit unit)
  • Method Details

    • setUnit

      protected final void setUnit(@NonNull @NonNull UtilizationModel.Unit unit)
      Sets the UtilizationModel.Unit in which the resource utilization is defined.
      Parameters:
      unit - UtilizationModel.Unit to set
    • getUtilization

      public final double getUtilization()
      Description copied from interface: UtilizationModel

      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 UtilizationModel.getUnit().

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

      Specified by:
      getUtilization in interface UtilizationModel
      Returns:
      the current resource utilization
      See Also:
    • getUtilization

      public final double getUtilization(double time)
      Description copied from interface: UtilizationModel

      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 UtilizationModel.getUnit().

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

      Specified by:
      getUtilization in interface UtilizationModel
      Parameters:
      time - the time to get the resource usage.
      Returns:
      the resource utilization at the given time
      See Also:
    • getUtilizationInternal

      protected abstract double getUtilizationInternal(double time)
    • validateUtilizationField

      protected void validateUtilizationField(String fieldName, double fieldValue)
      Checks if a given field has a valid value, considering that the minimum value is zero.
      Parameters:
      fieldName - the name of the field to display at the Exception when the value is invalid
      fieldValue - the current value of the field
    • validateUtilizationField

      protected void validateUtilizationField(String fieldName, double fieldValue, double minValue)