Class HostSuitability

java.lang.Object
org.cloudbus.cloudsim.hosts.HostSuitability

public final class HostSuitability
extends Object
A class that stores information about the suitability of a Host for placing a Vm. It provides fine-grained information to indicates if the Host is suitable in storage, ram, bandwidth and number of PEs required by the given Vm.
Since:
CloudSim Plus 6.0.2
Author:
Manoel Campos da Silva Filho
  • Field Summary

    Fields
    Modifier and Type Field Description
    static HostSuitability NULL  
  • Constructor Summary

    Constructors
    Constructor Description
    HostSuitability()  
    HostSuitability​(String reason)
    Creates a HostSuitability object.
  • Method Summary

    Modifier and Type Method Description
    boolean forBw()
    Checks if the Host has bandwidth suitability for running the VM.
    boolean forPes()
    Checks if the Host has Pe suitability for running the VM.
    boolean forRam()
    Checks if the Host has RAM suitability for running the VM.
    boolean forStorage()
    Checks if the Host has storage suitability for the size of the VM.
    boolean fully()
    Checks if the Host is totally suitable or not for the given Vm in terms of required storage, ram, bandwidth and number of PEs.
    void setSuitability​(HostSuitability other)
    Update the Host suitability based on another instance, making this object represent a combined suitability of different VMs for a single Host.
    String toString()
    Gets the reason the VM cannot be allocated to a host.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • HostSuitability

      public HostSuitability()
    • HostSuitability

      public HostSuitability​(String reason)
      Creates a HostSuitability object.
      Parameters:
      reason - the reason the Host is not suitable for a VM.
      See Also:
      toString()
  • Method Details

    • setSuitability

      public void setSuitability​(HostSuitability other)
      Update the Host suitability based on another instance, making this object represent a combined suitability of different VMs for a single Host. If at the end the suitability is false, that means the Host was not suitable for some VM(s) from other suitability instances.
      Parameters:
      other -
      See Also:
      VmGroup
    • forStorage

      public boolean forStorage()
      Checks if the Host has storage suitability for the size of the VM.
      Returns:
      true if it's suitable; false if it's unsuitable or this specific requirement was not even evaluated since other one was already not met.
      See Also:
      Host.setLazySuitabilityEvaluation(boolean)
    • forRam

      public boolean forRam()
      Checks if the Host has RAM suitability for running the VM.
      Returns:
      true if it's suitable; false if it's unsuitable or this specific requirement was not even evaluated since other one was already not met.
      See Also:
      Host.setLazySuitabilityEvaluation(boolean)
    • forBw

      public boolean forBw()
      Checks if the Host has bandwidth suitability for running the VM.
      Returns:
      true if it's suitable; false if it's unsuitable or this specific requirement was not even evaluated since other one was already not met.
      See Also:
      Host.setLazySuitabilityEvaluation(boolean)
    • forPes

      public boolean forPes()
      Checks if the Host has Pe suitability for running the VM.
      Returns:
      true if it's suitable; false if it's unsuitable or this specific requirement was not even evaluated since other one was already not met.
      See Also:
      Host.setLazySuitabilityEvaluation(boolean)
    • fully

      public boolean fully()
      Checks if the Host is totally suitable or not for the given Vm in terms of required storage, ram, bandwidth and number of PEs. If any of the requirements is not met, it means the host is not suitable at all.
      Returns:
      true if all resource requirements are met, false otherwise.
    • toString

      public String toString()
      Gets the reason the VM cannot be allocated to a host.
      Overrides:
      toString in class Object
      Returns:
      the reason or a empty string if the VM can be allocated.