Class MipsShare
java.lang.Object
org.cloudsimplus.schedulers.MipsShare
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty MIPS share, with no PEs and therefore no MIPS capacity.MipsShare(double mips) Creates a MIPS share with 1 PE having a given MIPS capacity.MipsShare(long pes, double mips) Creates a MIPS share with a defined number of PEs and MIPS capacity for each PE.Creates a MIPS share according to a givenProcessorcapacity.Creates a MipsShare object indicating the MIPS capacity and the number of PEs used during a VM boot process.A clone constructor that creates a MipsShare based on another one. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()Checks if there isn't MIPS capacity allocated to any PE, or if some capacity was already allocated.doublemips()longpes()Returns the number of allocated/requested PEs.longremove(long count) Removes a given number of PEs from the MIPS share.final voidsetMips(double mips) toString()double
-
Field Details
-
NULL
-
-
Constructor Details
-
MipsShare
public MipsShare()Creates an empty MIPS share, with no PEs and therefore no MIPS capacity. -
MipsShare
public MipsShare(double mips) Creates a MIPS share with 1 PE having a given MIPS capacity.- Parameters:
mips- the allocated or requested MIPS capacity for everyPe
-
MipsShare
-
MipsShare
public MipsShare(long pes, double mips) Creates a MIPS share with a defined number of PEs and MIPS capacity for each PE.- Parameters:
pes- the number of PEs sharedmips- the allocated or requested MIPS capacity for everyPe
-
MipsShare
Creates a MipsShare object indicating the MIPS capacity and the number of PEs used during a VM boot process.- Parameters:
processor- the VM processorbootModel- the VM boot model that defines how the boot process uses resources
-
-
Method Details
-
mips
public double mips()- Returns:
- the MIPS capacity for each
Pe.
-
setMips
public final void setMips(double mips) -
pes
public long pes()Returns the number of allocated/requested PEs. It indicates the size of the MIPS share.- Returns:
- the number of allocated/requested PEs
-
isEmpty
public boolean isEmpty()Checks if there isn't MIPS capacity allocated to any PE, or if some capacity was already allocated.- Returns:
- true if the MIPS share has no capacity, false otherwise
-
totalMips
public double totalMips()- Returns:
- the total MIPS capacity sum across all PEs.
-
remove
public long remove(long count) Removes a given number of PEs from the MIPS share. It won't remove more PEs than there is available.- Parameters:
count- number of PEs to remove- Returns:
- the number of actual removed PEs
-
toString
-