Processor

public final class Processor extends ResourceManageableAbstract

A Central Unit Processing (CPU) attached to a Vm and which can have multiple cores (Pes). It’s a also called a Virtual CPU (vCPU).

Author:Manoel Campos da Silva Filho

Fields

NULL

public static final Processor NULL

Constructors

Processor

public Processor(Vm vm, double pesMips, long numberOfPes)

Instantiates a Processor for a given VM.

Parameters:
  • vm – the Vm the processor will belong to
  • pesMips – MIPS of each Pe
  • numberOfPes – number of Pes

Methods

getAllocatedResource

public long getAllocatedResource()

Gets the number of used PEs.

getAvailableResource

public long getAvailableResource()

Gets the number of free PEs.

getCapacity

public long getCapacity()

Gets the number of Pes of the Processor

getMips

public double getMips()

Gets the individual MIPS of each Pe.

getTotalMips

public double getTotalMips()

Gets the sum of MIPS from all Pes.

getVm

public Vm getVm()

Gets the Vm the processor belongs to.

setCapacity

public boolean setCapacity(long numberOfPes)

Sets the number of Pes of the Processor

Parameters:
  • numberOfPes – the number of PEs to set

setMips

public void setMips(double newMips)

Sets the individual MIPS of each Pe.

Parameters:
  • newMips – the new MIPS of each PE