Package org.cloudsimplus.resources
Class PeSimple
java.lang.Object
org.cloudsimplus.resources.ResourceAbstract
org.cloudsimplus.resources.ResourceManageableAbstract
org.cloudsimplus.resources.PeSimple
- All Implemented Interfaces:
ChangeableId
,Identifiable
,Pe
,Resource
,ResourceCapacity
,ResourceManageable
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
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.cloudsimplus.resources.ResourceAbstract
capacity
Fields inherited from interface org.cloudsimplus.resources.ResourceManageable
NULL
-
Constructor Summary
ConstructorDescriptionPeSimple()
Creates a PE object with thedefault MIPS capacity
and using aPeProvisionerSimple
.PeSimple
(double mipsCapacity) Creates a PE object using aPeProvisionerSimple
.PeSimple
(double mipsCapacity, PeProvisioner peProvisioner) Creates a PE object.PeSimple
(int id, double mipsCapacity, PeProvisioner peProvisioner) Creates a PE object defining a given id. -
Method Summary
Modifier and TypeMethodDescriptionstatic double
Returns the default MIPS capacity.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
Checks if the PE is working (not failed).boolean
setCapacity
(double mipsCapacity) Sets the capacity of this Pe in MIPS (Million Instructions Per Second).static void
setDefaultMips
(double defaultMips) Sets the default MIPS capacity to be used to create PEs when the no-args constructor is used.final Pe
setPeProvisioner
(@NonNull PeProvisioner peProvisioner) Sets thePe.getPeProvisioner()
that manages the allocation of this physical PE to virtual machines.toString()
Methods inherited from class org.cloudsimplus.resources.ResourceManageableAbstract
addCapacity, allocateResource, deallocateAllResources, deallocateAndRemoveResource, deallocateResource, getAvailableResource, removeCapacity, setAllocatedResource, setAvailableResource, setCapacity, sumAvailableResource, sumCapacity
Methods inherited from class org.cloudsimplus.resources.ResourceAbstract
getAllocatedResource, 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.cloudsimplus.core.ChangeableId
setId
Methods inherited from interface org.cloudsimplus.core.Identifiable
getId
Methods inherited from interface org.cloudsimplus.resources.Pe
getCapacity, getPeProvisioner, getStatus, setCapacity, setStatus
Methods inherited from interface org.cloudsimplus.resources.Resource
getAllocatedResource, getAvailableResource, getPercentUtilization, getUnit, isAmountAvailable, isAmountAvailable, isAmountAvailable, isFull, isSubClassOf
Methods inherited from interface org.cloudsimplus.resources.ResourceManageable
addCapacity, allocateResource, allocateResource, deallocateAllResources, deallocateAndRemoveResource, deallocateResource, deallocateResource, isResourceAmountBeingUsed, isSuitable, removeCapacity, setAllocatedResource, setAllocatedResource, sumCapacity
-
Constructor Details
-
PeSimple
public PeSimple()Creates a PE object with thedefault MIPS capacity
and using aPeProvisionerSimple
. The id of the PE is just set when a List of PEs is assigned to a Host. -
PeSimple
public PeSimple(double mipsCapacity) Creates a PE object using aPeProvisionerSimple
. 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
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
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 idmipsCapacity
- 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 interfacePe
- Parameters:
mipsCapacity
- the MIPS capacity to set- Returns:
- true if mipsCapacity is greater than 0, false otherwise
-
setPeProvisioner
Description copied from interface:Pe
Sets thePe.getPeProvisioner()
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.- Specified by:
setPeProvisioner
in interfacePe
- Parameters:
peProvisioner
- the new PE provisioner- Returns:
-
toString
- Overrides:
toString
in classResourceManageableAbstract
-
isWorking
public boolean isWorking()Description copied from interface:Pe
Checks if the PE is working (not failed). -
isFailed
public boolean isFailed()Description copied from interface:Pe
Checks if the PE is failed. -
isFree
public boolean isFree()Description copied from interface:Pe
Checks if the PE is free to be used (it's idle). -
isBusy
public boolean isBusy()Description copied from interface:Pe
Checks if the PE is busy to be used (it's being used).
-