Package org.cloudbus.cloudsim.schedulers
Class MipsShare
java.lang.Object
org.cloudbus.cloudsim.schedulers.MipsShare
public class MipsShare extends Object
Represents the requested or allocated MIPS capacity for a given number of
Pe
s from a VM.- Since:
- CloudSim Plus 6.2.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MipsShare()
Creates an empty MIPS share, with no PEs.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.MipsShare(MipsShare share)
A clone constructor. -
Method Summary
Modifier and Type Method Description boolean
isEmpty()
Checks if there isn't MIPS capacity allocated to any PE.double
mips()
long
pes()
Gets the number of allocated/requested PEs, which indicates the size of the MIPS share.long
remove(long count)
Removes a given number of PEs from the MIPS share.void
setMips(double mips)
String
toString()
double
totalMips()
Gets the total MIPS capacity sum across all PEs.
-
Field Details
-
NULL
-
-
Constructor Details
-
MipsShare
public MipsShare()Creates an empty MIPS share, with no PEs. -
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
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 shared.mips
- the allocated or requested MIPS capacity for everyPe
-
-
Method Details
-
mips
public double mips() -
setMips
public final void setMips(double mips) -
pes
public long pes()Gets the number of allocated/requested PEs, which indicates the size of the MIPS share.- Returns:
-
isEmpty
public boolean isEmpty()Checks if there isn't MIPS capacity allocated to any PE.- Returns:
-
totalMips
public double totalMips()Gets the total MIPS capacity sum across all PEs.- Returns:
-
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
-