Interface TimeZoned
- All Known Subinterfaces:
Datacenter
,Vm
- All Known Implementing Classes:
DatacenterSimple
,NetworkDatacenter
,NetworkVm
,VmGroup
,VmSimple
public interface TimeZoned
An interface to be implemented by objects that
are physically placed into some time zone,
such as
Datacenter
and Vm
.- Since:
- CloudSim Plus 4.6.0
- Author:
- Manoel Campos da Silva Filho
-
Method Summary
Modifier and Type Method Description static Datacenter
closestDatacenter(Vm vm, List<Datacenter> datacenters)
Selects theDatacenter
closest to a givenVm
, based on their timezone.default double
distance(TimeZoned other)
Computes the distance between this and otherTimeZoned
object, considering their timezone offset values.static String
format(double timeZone)
double
getTimeZone()
Gets the time zone offset, a value between [-12 and 12], in which the object is physically located.TimeZoned
setTimeZone(double timeZone)
Sets the time zone offset between [-12 and 12].default double
validateTimeZone(double timeZone)
-
Method Details
-
getTimeZone
double getTimeZone()Gets the time zone offset, a value between [-12 and 12], in which the object is physically located.- Returns:
- the time zone offset
-
setTimeZone
Sets the time zone offset between [-12 and 12].- Parameters:
timeZone
- the new time zone offset- Returns:
-
validateTimeZone
default double validateTimeZone(double timeZone) -
closestDatacenter
Selects theDatacenter
closest to a givenVm
, based on their timezone. It considers the Datacenter list is already sorted by timezone.- Parameters:
vm
- to Vm to try place into the closest Datacenterdatacenters
- the list of available Datacenters, sorted by timezone- Returns:
- the first selected Datacenter
-
distance
Computes the distance between this and otherTimeZoned
object, considering their timezone offset values.- Parameters:
other
- the otherTimeZoned
object to check the distance to- Returns:
- a positive integer value representing the distance between the objects
-
format
-