Class PeSimple

All Implemented Interfaces:
ChangeableId, Identifiable, Pe, Resource, ResourceCapacity, ResourceManageable

public class PeSimple extends ResourceManageableAbstract implements Pe
Pe (Processing Element) class represents a CPU core of a physical machine (PM), defined in terms of Millions Instructions Per Second (MIPS) rating. Such a class allows managing the Pe capacity and allocation.

ASSUMPTION: All PEs under the same Machine have the same MIPS rating.

TODO: This assumption is not being assured on different classes (where other TODOs were included)
Since:
CloudSim Toolkit 1.0
Author:
Manzur Murshed, Rajkumar Buyya
  • Constructor Details

    • PeSimple

      public PeSimple()
      Creates a PE object with the default MIPS capacity and using a PeProvisionerSimple. The id of the PE is just set when a List of PEs is assigned to a Host.
      See Also:
    • PeSimple

      public PeSimple(double mipsCapacity)
      Creates a PE object using a PeProvisionerSimple. The id of the PE is just set when a List of PEs is assigned to a Host.
      Parameters:
      mipsCapacity - the capacity of the PE in MIPS (Million Instructions per Second)
      See Also:
    • PeSimple

      public PeSimple(double mipsCapacity, PeProvisioner peProvisioner)
      Creates a PE object. The id of the PE is just set when a List of PEs is assigned to a Host.
      Parameters:
      mipsCapacity - the capacity of the PE in MIPS (Million Instructions per Second)
      peProvisioner - the provisioner that will manage the allocation of this physical Pe for VMs
      See Also:
    • PeSimple

      public PeSimple(int id, double mipsCapacity, PeProvisioner peProvisioner)
      Creates a PE object defining a given id. The id of the PE is just set when a List of PEs is assigned to a Host.
      Parameters:
      id - the PE id
      mipsCapacity - the capacity of the PE in MIPS (Million Instructions per Second)
      peProvisioner - the provisioner that will manage the allocation of this physical Pe for VMs
      See Also:
  • Method Details

    • getDefaultMips

      public static double getDefaultMips()
      Returns the default MIPS capacity. to be used to create PEs when the no-args constructor is used.
      Returns:
      the default MIPS capacity
    • setDefaultMips

      public static void setDefaultMips(double defaultMips)
      Sets the default MIPS capacity to be used to create PEs when the no-args constructor is used.
      Parameters:
      defaultMips - the new default MIPS capacity to set
    • setCapacity

      public boolean setCapacity(double mipsCapacity)
      Description copied from interface: Pe
      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.
      Specified by:
      setCapacity in interface Pe
      Parameters:
      mipsCapacity - the MIPS capacity to set
      Returns:
      true if mipsCapacity is greater than 0, false otherwise
    • setPeProvisioner

      public final Pe setPeProvisioner(@NonNull @NonNull PeProvisioner peProvisioner)
      Description copied from interface: Pe
      Sets the Pe.getPeProvisioner() that manages the allocation of this physical PE to virtual machines. 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.
      Specified by:
      setPeProvisioner in interface Pe
      Parameters:
      peProvisioner - the new PE provisioner
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class ResourceManageableAbstract
    • isWorking

      public boolean isWorking()
      Description copied from interface: Pe
      Checks if the PE is working (not failed).
      Specified by:
      isWorking in interface Pe
      Returns:
    • isFailed

      public boolean isFailed()
      Description copied from interface: Pe
      Checks if the PE is failed.
      Specified by:
      isFailed in interface Pe
      Returns:
    • isFree

      public boolean isFree()
      Description copied from interface: Pe
      Checks if the PE is free to be used (it's idle).
      Specified by:
      isFree in interface Pe
      Returns:
    • isBusy

      public boolean isBusy()
      Description copied from interface: Pe
      Checks if the PE is busy to be used (it's being used).
      Specified by:
      isBusy in interface Pe
      Returns: