Package org.cloudbus.cloudsim.resources
Interface Pe
- All Superinterfaces:
ChangeableId
,Identifiable
,Resource
,ResourceCapacity
,ResourceManageable
- All Known Implementing Classes:
PeSimple
public interface Pe extends ChangeableId, ResourceManageable
A interface to be implemented by each class that provides
the basic features of a virtual or physical Processing Element (PE)
of a PM 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
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Pe.Status
Status of PEs. -
Field Summary
-
Method Summary
Modifier and Type Method Description long
getCapacity()
Gets the capacity of this Pe in MIPS (Million Instructions Per Second).PeProvisioner
getPeProvisioner()
Gets the PE provisioner that manages the allocation of this physical PE to virtual machines.Pe.Status
getStatus()
Gets the status of the PE.boolean
isBusy()
Checks if the PE is busy to be used (it's being used).boolean
isFailed()
Checks if the PE is failed.boolean
isFree()
Checks if the PE is free to be used (it's idle).boolean
isWorking()
Checks if the PE is working (not failed).boolean
setCapacity(double mipsCapacity)
Sets the capacity of this Pe in MIPS (Million Instructions Per Second).boolean
setCapacity(long mipsCapacity)
Sets the capacity of this Pe in MIPS (Million Instructions Per Second).Pe
setPeProvisioner(PeProvisioner peProvisioner)
Sets thegetPeProvisioner()
that manages the allocation of this physical PE to virtual machines.boolean
setStatus(Pe.Status status)
Sets thestatus
of the PE.Methods inherited from interface org.cloudbus.cloudsim.core.ChangeableId
setId
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.resources.Resource
getAllocatedResource, getAvailableResource, getPercentUtilization, isAmountAvailable, isAmountAvailable, isAmountAvailable, isFull, isSubClassOf
Methods inherited from interface org.cloudbus.cloudsim.resources.ResourceManageable
addCapacity, allocateResource, allocateResource, deallocateAllResources, deallocateAndRemoveResource, deallocateResource, deallocateResource, isResourceAmountBeingUsed, isSuitable, removeCapacity, setAllocatedResource, setAllocatedResource, sumCapacity
-
Field Details
-
NULL
An attribute that implements the Null Object Design Pattern forPe
objects.
-
-
Method Details
-
getCapacity
long getCapacity()Gets the capacity of this Pe in MIPS (Million Instructions Per Second).- Specified by:
getCapacity
in interfaceResourceCapacity
- 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 interfaceResourceManageable
- Parameters:
mipsCapacity
- the MIPS capacity to set- Returns:
- true if mipsCapacity is greater than 0, false otherwise
- See Also:
Resource.getAllocatedResource()
-
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
Sets thegetPeProvisioner()
that manages the allocation of this physical PE to virtual machines. This method is automatically called when aPeProvisioner
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:
-
getPeProvisioner
PeProvisioner getPeProvisioner()Gets the PE provisioner that manages the allocation of this physical PE to virtual machines.- Returns:
- the PE provisioner
-
getStatus
Pe.Status getStatus()Gets the status of the PE.- Returns:
- the PE status
-
setStatus
Sets thestatus
of the PE.- Parameters:
status
- the new PE status- Returns:
- true if the status was set, false otherwise
-
isWorking
boolean isWorking()Checks if the PE is working (not failed).- Returns:
-
isFailed
boolean isFailed()Checks if the PE is failed.- Returns:
-
isFree
boolean isFree()Checks if the PE is free to be used (it's idle).- Returns:
-
isBusy
boolean isBusy()Checks if the PE is busy to be used (it's being used).- Returns:
-