Class PeSimple
- All Implemented Interfaces:
ChangeableId,Identifiable,Pe,Resource,ResourceCapacity,ResourceManageable
A Pe (Processing Element) implementation representing a CPU core of a physical machine
(Host), defined in terms of Millions Instructions Per Second (MIPS).
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
capacityFields inherited from interface org.cloudsimplus.resources.ResourceManageable
NULL -
Constructor Summary
ConstructorsConstructorDescriptionPeSimple()Creates a PE object with the
and using ainvalid reference
default MIPS capacity
PeProvisionerSimple.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 TypeMethodDescriptionbooleanisBusy()Checks if the PE is busy to be used (it's being used).booleanisFailed()Checks if the PE is failed.booleanisFree()Checks if the PE is free to be used (it's idle).booleanChecks if the PE is working (not failed).booleansetCapacity(double mipsCapacity) Sets the capacity of this Pe in MIPS (Million Instructions Per Second).static voidsetDefaultMips(double defaultMips) Sets the default MIPS capacity to be used to create PEs when the no-args constructor is used.final PesetPeProvisioner(@NonNull PeProvisioner peProvisioner) Sets thePe.getPeProvisioner()that manages the allocation of this physical PE toVms.toString()Methods inherited from class org.cloudsimplus.resources.ResourceManageableAbstract
addCapacity, allocateResource, deallocateAllResources, deallocateAndRemoveResource, deallocateResource, getAvailableResource, removeCapacity, setAllocatedResource, setAvailableResource, setCapacity, sumAvailableResource, sumCapacityMethods inherited from class org.cloudsimplus.resources.ResourceAbstract
getAllocatedResource, isAmountAvailable, isAmountAvailable, isResourceAmountBeingUsed, isSuitableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cloudsimplus.core.ChangeableId
setIdMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.resources.Pe
getCapacity, getPeProvisioner, getStatus, setCapacity, setStatusMethods inherited from interface org.cloudsimplus.resources.Resource
getAllocatedResource, getAvailableResource, getPercentUtilization, getUnit, isAmountAvailable, isAmountAvailable, isAmountAvailable, isFull, isSubClassOfMethods 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 the
and using ainvalid reference
default MIPS capacity
PeProvisionerSimple.The id of the PE is just set when a List of PEs is assigned to a Host.
- See Also:
-
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
-
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:PeSets the capacity of this Pe in MIPS (Million Instructions Per Second).
It receives the amount of MIPS as a
doublevalue but converts it internally to along. The method is just provided as a handy way to define the PE capacity using adoublevalue 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:
setCapacityin interfacePe- Parameters:
mipsCapacity- the MIPS capacity to set- Returns:
- true if
mipsCapacityis greater than 0, false otherwise
-
setPeProvisioner
Description copied from interface:PeSets thePe.getPeProvisioner()that manages the allocation of this physical PE toVms. This method is automatically called when aPeProvisioneris created passing a Pe instance. Thus, the PeProvisioner for a Pe doesn't have to be set manually.- Specified by:
setPeProvisionerin interfacePe- Parameters:
peProvisioner- the new PE provisioner- Returns:
- this instance
-
toString
- Overrides:
toStringin classResourceManageableAbstract
-
isWorking
-
isFailed
-
isFree
-
isBusy
-