Interface Machine<T extends Resource>

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

public interface Machine<T extends Resource> extends ChangeableId, Resourceful, ExecDelayable
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 Details

    • NULL

      static final Machine NULL
      An attribute that implements the Null Object Design Pattern for Machine objects.
  • Method Details

    • getBw

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

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

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

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

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

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

      Simulation getSimulation()
      Specified by:
      getSimulation in interface Startable
      Returns:
      the CloudSimPlus instance that represents the simulation the Entity belongs to.
    • 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 or 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()
      Description copied from interface: Startable
      Gets the last time the entity was running some process or Startable.NOT_ASSIGNED if it has not been busy yet.
      Specified by:
      getLastBusyTime in interface Startable
      Returns:
      the last time the Machine was running some process (in seconds).
    • isIdle

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

      static void validateCapacity(double capacity)
      Validates a capacity for a machine resource.
      Parameters:
      capacity - the capacity to check
      Throws:
      IllegalArgumentException - if the given capacity is zero or negative