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 the Datacenter closest to a given Vm, based on their timezone.
    default double distance​(TimeZoned other)
    Computes the distance between this and other TimeZoned 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

      TimeZoned setTimeZone​(double timeZone)
      Sets the time zone offset between [-12 and 12].
      Parameters:
      timeZone - the new time zone offset
      Returns:
    • validateTimeZone

      default double validateTimeZone​(double timeZone)
    • closestDatacenter

      static Datacenter closestDatacenter​(Vm vm, List<Datacenter> datacenters)
      Selects the Datacenter closest to a given Vm, based on their timezone. It considers the Datacenter list is already sorted by timezone.
      Parameters:
      vm - to Vm to try place into the closest Datacenter
      datacenters - the list of available Datacenters, sorted by timezone
      Returns:
      the first selected Datacenter
    • distance

      default double distance​(TimeZoned other)
      Computes the distance between this and other TimeZoned object, considering their timezone offset values.
      Parameters:
      other - the other TimeZoned object to check the distance to
      Returns:
      a positive integer value representing the distance between the objects
    • format

      static String format​(double timeZone)