Package org.cloudbus.cloudsim.resources
Class Processor
java.lang.Object
org.cloudbus.cloudsim.resources.ResourceAbstract
org.cloudbus.cloudsim.resources.ResourceManageableAbstract
org.cloudbus.cloudsim.resources.Processor
- All Implemented Interfaces:
Resource
,ResourceCapacity
,ResourceManageable
public final class Processor extends ResourceManageableAbstract
A Central Unit Processing (CPU) attached to a
Vm
and which can have multiple
cores (Pe
s). It's a also called a Virtual CPU (vCPU).- Since:
- CloudSim Plus 1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Fields inherited from class org.cloudbus.cloudsim.resources.ResourceAbstract
capacity
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description long
getAllocatedResource()
Gets the number of used PEs.long
getAvailableResource()
Gets the number of free PEs.long
getCapacity()
Gets the number ofPe
s of the Processordouble
getMips()
Gets the individual MIPS of eachPe
.double
getTotalMips()
Gets the sum of MIPS from allPe
s.Vm
getVm()
Gets theVm
the processor belongs to.boolean
setCapacity(long numberOfPes)
Sets the number ofPe
s of the Processorvoid
setMips(double newMips)
Sets the individual MIPS of eachPe
.Methods inherited from class org.cloudbus.cloudsim.resources.ResourceManageableAbstract
addCapacity, allocateResource, deallocateAllResources, deallocateAndRemoveResource, deallocateResource, removeCapacity, setAllocatedResource, setAvailableResource, sumAvailableResource, sumCapacity, toString
Methods inherited from class org.cloudbus.cloudsim.resources.ResourceAbstract
getUnit, isAmountAvailable, isAmountAvailable, isResourceAmountBeingUsed, isSuitable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cloudbus.cloudsim.resources.Resource
getPercentUtilization, getUnit, isAmountAvailable, isAmountAvailable, isAmountAvailable, isFull, isSubClassOf
Methods inherited from interface org.cloudbus.cloudsim.resources.ResourceManageable
allocateResource, deallocateResource, isResourceAmountBeingUsed, isSuitable, setAllocatedResource
-
Field Details
-
NULL
-
-
Constructor Details
-
Method Details
-
getTotalMips
public double getTotalMips()Gets the sum of MIPS from allPe
s.- Returns:
-
getMips
public double getMips()Gets the individual MIPS of eachPe
.- Returns:
-
setMips
public void setMips(double newMips)Sets the individual MIPS of eachPe
.- Parameters:
newMips
- the new MIPS of each PE
-
getCapacity
public long getCapacity()Gets the number ofPe
s of the Processor- Specified by:
getCapacity
in interfaceResourceCapacity
- Overrides:
getCapacity
in classResourceAbstract
- Returns:
-
getAvailableResource
public long getAvailableResource()Gets the number of free PEs.- Specified by:
getAvailableResource
in interfaceResource
- Overrides:
getAvailableResource
in classResourceManageableAbstract
- Returns:
-
getAllocatedResource
public long getAllocatedResource()Gets the number of used PEs.- Specified by:
getAllocatedResource
in interfaceResource
- Overrides:
getAllocatedResource
in classResourceAbstract
- Returns:
-
setCapacity
public boolean setCapacity(long numberOfPes)Sets the number ofPe
s of the Processor- Specified by:
setCapacity
in interfaceResourceManageable
- Overrides:
setCapacity
in classResourceManageableAbstract
- Parameters:
numberOfPes
- the number of PEs to set- Returns:
- See Also:
Resource.getAllocatedResource()
-
getVm
Gets theVm
the processor belongs to.- Returns:
-