Interface UtilizationModel
- All Known Implementing Classes:
UtilizationModelAbstract
,UtilizationModelDynamic
,UtilizationModelFull
,UtilizationModelPlanetLab
,UtilizationModelStochastic
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
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Defines the unit of the resource utilization. -
Field Summary
Modifier and TypeFieldDescriptionstatic final UtilizationModel
An attribute that implements the Null Object Design Pattern forUtilizationModel
objects using a Lambda Expression. -
Method Summary
Modifier and TypeMethodDescriptionGets the simulation that this UtilizationModel belongs to.getUnit()
Gets theUtilizationModel.Unit
in which the resource utilization is defined.double
Gets the expected utilization of resource at the current simulation time.double
getUtilization
(double time) Gets the expected utilization of resource at a given simulation time.boolean
Checks if the resource utilization requested by a Cloudlet is allowed to exceed 100% or not.setOverCapacityRequestAllowed
(boolean allow) Allow the resource utilization requested by a Cloudlet to exceed 100% or not.setSimulation
(Simulation simulation) Sets the simulation that this UtilizationModel belongs to.
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forUtilizationModel
objects using a Lambda Expression. ACloudlet
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
UtilizationModel.Unit getUnit()Gets theUtilizationModel.Unit
in which the resource utilization is defined.- Returns:
-
setSimulation
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 thegetUnit()
.It is an expected usage value because the actual
Cloudlet
resource usage depends on the availableVm
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 thegetUnit()
.It is an expected usage value because the actual
Cloudlet
resource usage depends on the availableVm
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 asUtilizationModel.Unit.PERCENTAGE
.- Returns:
- true if Cloudlets can request more than 100% of a resource, false otherwise
- See Also:
-
setOverCapacityRequestAllowed
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 thegetUtilization(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) andUtilizationModelStochastic
(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 asUtilizationModel.Unit.PERCENTAGE
.- Parameters:
allow
- true to allow requesting more than 100% of a resource, false to disallow that- Returns:
-