Interface AbstractMachine

All Superinterfaces:
ChangeableId, Identifiable, Resourceful
All Known Subinterfaces:
Host, Machine, Vm
All Known Implementing Classes:
HostSimple, NetworkHost, NetworkVm, VmGroup, VmSimple

public interface AbstractMachine
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 AbstractMachine NULL
    An attribute that implements the Null Object Design Pattern for AbstractMachine objects.
  • Method Summary

    Modifier and Type Method Description
    Resource getBw()
    Gets the machine bandwidth (bw) capacity in Megabits/s.
    default double getIdleInterval()
    Gets the time interval the Machine has been idle.
    double getLastBusyTime()
    Gets the last time the Machine was running some process.
    double getMips()
    Gets the individual MIPS capacity of any machine's Pe, considering that all PEs have the same capacity.
    long getNumberOfPes()
    Gets the overall number of Pes the machine has, that include PEs of all statuses, including failed PEs.
    Resource getRam()
    Gets the machine memory resource in Megabytes.
    Simulation getSimulation()
    Gets the CloudSim instance that represents the simulation the Entity is related to.
    double getStartTime()
    Gets the last time the machine was started up (in seconds).
    Resource getStorage()
    Gets the storage device of the machine with capacity in Megabytes.
    double getTotalMipsCapacity()
    Gets total MIPS capacity of all PEs of the machine.
    default boolean isIdle()
    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).
    AbstractMachine 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 the machine bandwidth (bw) capacity in Megabits/s.
      Returns:
      the machine bw capacity
    • getRam

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

      Resource 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 is related 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