Class UtilizationModelAbstract
java.lang.Object
org.cloudsimplus.utilizationmodels.UtilizationModelAbstract
- All Implemented Interfaces:
UtilizationModel
- Direct Known Subclasses:
UtilizationModelDynamic,UtilizationModelFull,UtilizationModelPlanetLab,UtilizationModelStochastic
An abstract class to implement
UtilizationModels.- Since:
- CloudSim Plus 1.2
- Author:
- Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.utilizationmodels.UtilizationModel
UtilizationModel.Unit -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleIndicates that values lower or equal to this will be considered as zero.Fields inherited from interface org.cloudsimplus.utilizationmodels.UtilizationModel
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal doubleGets the expected utilization of resource at the current simulation time.final doublegetUtilization(double time) Gets the expected utilization of resource at a given simulation time.protected abstract doublegetUtilizationInternal(double time) protected final voidsetUnit(@NonNull UtilizationModel.Unit unit) Sets theUtilizationModel.Unitin which the resource utilization is defined.protected voidvalidateUtilizationField(String fieldName, double fieldValue) Checks if a given field has a valid value, considering that the minimum value is zero.protected voidvalidateUtilizationField(String fieldName, double fieldValue, double minValue) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudsimplus.utilizationmodels.UtilizationModel
getSimulation, getUnit, isOverCapacityRequestAllowed, setOverCapacityRequestAllowed, setSimulation
-
Field Details
-
ALMOST_ZERO
public static final double ALMOST_ZEROIndicates 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
-
-
Method Details
-
setUnit
Sets theUtilizationModel.Unitin which the resource utilization is defined.- Parameters:
unit-UtilizationModel.Unitto set
-
getUtilization
public final double getUtilization()Description copied from interface:UtilizationModelGets 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
Cloudletresource usage depends on the availableVmresource.- Specified by:
getUtilizationin interfaceUtilizationModel- Returns:
- the current resource utilization
- See Also:
-
getUtilization
public final double getUtilization(double time) Description copied from interface:UtilizationModelGets 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
Cloudletresource usage depends on the availableVmresource.- Specified by:
getUtilizationin interfaceUtilizationModel- 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
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 invalidfieldValue- the current value of the field
-
validateUtilizationField
-