Class Processor

All Implemented Interfaces:
Resource, ResourceCapacity, ResourceManageable

public final class Processor extends ResourceManageableAbstract
A virtual Central Processing Unit (vCPU) attached to a Vm, having one or more cores (Pes).
Since:
CloudSim Plus 1.0
Author:
Manoel Campos da Silva Filho
  • Field Details

  • Constructor Details

    • Processor

      public Processor(Vm vm, long pesNumber, double pesMips)
      Instantiates a Processor for a given VM.
      Parameters:
      vm - the Vm to which the processor will belong to
      pesNumber - number of Pes (the processor capacity)
      pesMips - MIPS of each Pe
  • Method Details

    • getTotalMips

      public double getTotalMips()
      Returns:
      the sum of MIPS from all Pes.
    • setMips

      public void setMips(double newMips)
      Sets the individual MIPS of each Pe.
      Parameters:
      newMips - the new MIPS of each PE
    • getCapacity

      public long getCapacity()
      Returns:
      the number of Pes of the Processor
    • setCapacity

      public boolean setCapacity(long pesNumber)
      Sets the number of Pes of the Processor
      Specified by:
      setCapacity in interface ResourceManageable
      Overrides:
      setCapacity in class ResourceManageableAbstract
      Parameters:
      pesNumber - the number of PEs to set
      Returns:
      true if the capacity was set, false otherwise
      See Also:
    • getAvailableResource

      public long getAvailableResource()
      Description copied from interface: Resource
      Returns the available amount of the resource that is free to be used. The data unit depends on the implementing classes.
      Specified by:
      getAvailableResource in interface Resource
      Overrides:
      getAvailableResource in class ResourceManageableAbstract
      Returns:
      the number of available PEs that are free to be used
    • getAllocatedResource

      public long getAllocatedResource()
      Description copied from interface: Resource
      Returns the current total amount of allocated resource. The data unit depends on the implementing classes, according to the Resource.getUnit().
      Specified by:
      getAllocatedResource in interface Resource
      Overrides:
      getAllocatedResource in class ResourceAbstract
      Returns:
      the number of PEs allocated