Interface Pe

All Superinterfaces:
ChangeableId, Identifiable, Resource, ResourceCapacity, ResourceManageable
All Known Implementing Classes:
PeSimple

public interface Pe extends ChangeableId, ResourceManageable
An interface to be implemented by each class that provides the basic features for a virtual or physical Processing Element (PE) of a Host or Vm. Each Pe represents a virtual or physical processor core and its capacity is defined in MIPS (Million Instructions Per Second).
Since:
CloudSim Plus 1.0
Author:
Manzur Murshed, Rajkumar Buyya, Manoel Campos da Silva Filho
  • Field Details

    • NULL

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

    • getCapacity

      long getCapacity()
      Gets the capacity of this Pe in MIPS (Million Instructions Per Second).
      Specified by:
      getCapacity in interface ResourceCapacity
      Returns:
      the MIPS capacity
    • setCapacity

      boolean setCapacity(long mipsCapacity)
      Sets the capacity of this Pe in MIPS (Million Instructions Per Second). If you want to have an idea of the MIPS capacity for different processors, check the link above.
      Specified by:
      setCapacity in interface ResourceManageable
      Parameters:
      mipsCapacity - the MIPS capacity to set
      Returns:
      true if mipsCapacity is greater than 0, false otherwise
      See Also:
    • setCapacity

      boolean setCapacity(double mipsCapacity)

      Sets the capacity of this Pe in MIPS (Million Instructions Per Second).

      It receives the amount of MIPS as a double value but converts it internally to a long. The method is just provided as a handy way to define the PE capacity using a double value that usually is generated from some computations. If you want to have an idea of the MIPS capacity for different processors, check the link above.

      Parameters:
      mipsCapacity - the MIPS capacity to set
      Returns:
      true if mipsCapacity is greater than 0, false otherwise
    • setPeProvisioner

      Pe setPeProvisioner(PeProvisioner peProvisioner)
      Sets the getPeProvisioner() that manages the allocation of this physical PE to Vms. This method is automatically called when a PeProvisioner is created passing a Pe instance. Thus, the PeProvisioner for a Pe doesn't have to be set manually.
      Parameters:
      peProvisioner - the new PE provisioner
      Returns:
      this instance
    • getPeProvisioner

      PeProvisioner getPeProvisioner()
      Gets the PeProvisioner that manages the allocation of this physical PE to Vms.
      Returns:
      the PE provisioner
    • getStatus

      Pe.Status getStatus()
      Returns:
      the status of the PE.
    • setStatus

      Pe setStatus(Pe.Status status)
      Sets the status of the PE.
      Parameters:
      status - the new PE status
    • isWorking

      boolean isWorking()
      Checks if the PE is working (not failed).
      Returns:
      true if the PE is working, false otherwise
    • isFailed

      boolean isFailed()
      Checks if the PE is failed.
      Returns:
      true if the PE is failed, false otherwise
    • isFree

      boolean isFree()
      Checks if the PE is free to be used (it's idle).
      Returns:
      true if the PE is free, false otherwise
    • isBusy

      boolean isBusy()
      Checks if the PE is busy to be used (it's being used).
      Returns:
      true if the PE is busy, false otherwise