Interface AbstractMachine<T extends Resource>

Type Parameters:
T - The type of the storage device for the machine
All Superinterfaces:
ChangeableId, Identifiable, Resourceful
All Known Subinterfaces:
Host, Machine, Vm
All Known Implementing Classes:
HostSimple, NetworkHost, NetworkVm, VmGroup, VmSimple

public interface AbstractMachine<T extends Resource> extends ChangeableId, Resourceful
Represents either a: (i) Physical Machine (PM) which implements the Host interface; or (ii) Virtual Machine (VM), which implements the Vm interface.
Since:
CloudSim Plus 5.1.4
Author:
Manoel Campos da Silva Filho
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AbstractMachine
    An attribute that implements the Null Object Design Pattern for AbstractMachine objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a resource representing the machine bandwidth (bw) in Megabits/s.
    default double
    Gets the time interval the Machine has been idle.
    double
    Gets the last time the Machine was running some process.
    double
    Gets the individual MIPS capacity of any machine's Pe, considering that all PEs have the same capacity.
    long
    Gets the overall number of Pes the machine has, that include PEs of all statuses, including failed PEs.
    Gets a resource representing the machine memory in Megabytes.
    Gets the CloudSim instance that represents the simulation the Entity belongs to.
    double
    Gets the last time the machine was started up (in seconds).
    Gets the storage device of the machine with capacity in Megabytes.
    double
    Gets total MIPS capacity of all PEs of the machine.
    default boolean
    Checks if the Machine is currently idle.
    default boolean
    isIdleEnough(double time)
    Checks if the Machine has been idle for a given amount of time (in seconds).
    setStartTime(double startTime)
    Sets the current machine startup time.
    static void
    validateCapacity(double capacity)
    Validates a capacity for a machine resource.

    Methods inherited from interface org.cloudbus.cloudsim.core.ChangeableId

    setId

    Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable

    getId

    Methods inherited from interface org.cloudbus.cloudsim.resources.Resourceful

    getResource, getResources
  • Field Details

  • Method Details

    • getBw

      Resource getBw()
      Gets a resource representing the machine bandwidth (bw) in Megabits/s.
      Returns:
      the machine bw resource
    • getRam

      Resource getRam()
      Gets a resource representing the machine memory in Megabytes.
      Returns:
      the machine memory
    • getStorage

      T getStorage()
      Gets the storage device of the machine with capacity in Megabytes.
      Returns:
      the machine storage device
    • getNumberOfPes

      long getNumberOfPes()
      Gets the overall number of Pes the machine has, that include PEs of all statuses, including failed PEs.
      Returns:
      the machine's number of PEs
    • getMips

      double getMips()
      Gets the individual MIPS capacity of any machine's Pe, considering that all PEs have the same capacity.
      Returns:
      the MIPS capacity of a single Pe
    • getTotalMipsCapacity

      double getTotalMipsCapacity()
      Gets total MIPS capacity of all PEs of the machine.
      Returns:
      the total MIPS of all PEs
    • getSimulation

      Simulation getSimulation()
      Gets the CloudSim instance that represents the simulation the Entity belongs to.
      Returns:
    • getStartTime

      double getStartTime()
      Gets the last time the machine was started up (in seconds). The value -1 means it was not started yet.
      Returns:
    • setStartTime

      AbstractMachine setStartTime(double startTime)
      Sets the current machine startup time. The value -1 means it was not started yet.
      Parameters:
      startTime - the start time to set (in seconds)
      Returns:
    • isIdleEnough

      default boolean isIdleEnough(double time)
      Checks if the Machine has been idle for a given amount of time (in seconds).
      Parameters:
      time - the time interval to check if the Machine has been idle (in seconds). If time is zero, it will be checked if the Machine is currently idle. If it's negative, even if the Machine is idle, it's considered that it isn't idle enough. This is useful if you don't want to perform any operation when the machine becomes idle (for instance, if idle machines might be shut down and a negative value is given, they won't).
      Returns:
      true if the Machine has been idle as long as the given time; false if it's active of isn't idle long enough
    • getIdleInterval

      default double getIdleInterval()
      Gets the time interval the Machine has been idle.
      Returns:
      the idle time interval (in seconds) or 0 if the Machine is not idle
    • getLastBusyTime

      double getLastBusyTime()
      Gets the last time the Machine was running some process.
      Returns:
      the last busy time (in seconds)
    • isIdle

      default boolean isIdle()
      Checks if the Machine is currently idle.
      Returns:
      true if the Machine currently idle, false otherwise
    • validateCapacity

      static void validateCapacity(double capacity)
      Validates a capacity for a machine resource.
      Parameters:
      capacity - the capacity to check