Class MipsShare

java.lang.Object
org.cloudsimplus.schedulers.MipsShare

public class MipsShare extends Object
Represents the requested or allocated MIPS (Million Instructions Per Second) capacity for a given number of Pes from a VM.
Since:
CloudSim Plus 6.2.0
Author:
Manoel Campos da Silva Filho
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MipsShare
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates 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.
    MipsShare(@NonNull Processor processor)
    Creates a MIPS share according to a given Processor capacity.
    MipsShare(@NonNull Processor processor, @NonNull BootModel bootModel)
    Creates a MipsShare object indicating the MIPS capacity and the number of PEs used during a VM boot process.
    MipsShare(@NonNull MipsShare share)
    A clone constructor that creates a MipsShare based on another one.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if there isn't MIPS capacity allocated to any PE, or if some capacity was already allocated.
    double
     
    long
    pes()
    Returns the number of allocated/requested PEs.
    long
    remove(long count)
    Removes a given number of PEs from the MIPS share.
    final void
    setMips(double mips)
     
     
    double
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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 every Pe
    • MipsShare

      public MipsShare(@NonNull @NonNull Processor processor)
      Creates a MIPS share according to a given Processor capacity.
      Parameters:
      processor - the processor to get its capacity to create the 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 shared
      mips - the allocated or requested MIPS capacity for every Pe
    • MipsShare

      public MipsShare(@NonNull @NonNull MipsShare share)
      A clone constructor that creates a MipsShare based on another one.
      Parameters:
      share - the MIPS share to clone
    • MipsShare

      public MipsShare(@NonNull @NonNull Processor processor, @NonNull @NonNull BootModel bootModel)
      Creates a MipsShare object indicating the MIPS capacity and the number of PEs used during a VM boot process.
      Parameters:
      processor - the VM processor
      bootModel - 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

      public String toString()
      Overrides:
      toString in class Object