Class VmSelectionPolicyRandomSelection

java.lang.Object
org.cloudsimplus.selectionpolicies.VmSelectionPolicyRandomSelection
All Implemented Interfaces:
VmSelectionPolicy

public class VmSelectionPolicyRandomSelection extends Object implements VmSelectionPolicy
A VM selection policy that randomly selects Vms to migrate from a host. It uses a uniform Pseudo Random Number Generator (PRNG) as default to select VMs.
Since:
CloudSim Toolkit 3.0
Author:
Anton Beloglazov, Manoel Campos da Silva Filho
  • Constructor Details

    • VmSelectionPolicyRandomSelection

      public VmSelectionPolicyRandomSelection()
      Creates a PowerVmSelectionPolicyRandomSelection using a uniform Pseudo Random Number Generator (PRNG) as default to select VMs to migrate.
    • VmSelectionPolicyRandomSelection

      public VmSelectionPolicyRandomSelection(@NonNull @NonNull ContinuousDistribution rand)
      Creates a PowerVmSelectionPolicyRandomSelection using a given Pseudo Random Number Generator (PRNG) to select VMs to migrate.
      Parameters:
      rand - a Pseudo Random Number Generator (PRNG) to randomly select VMs to migrate.
  • Method Details

    • getVmToMigrate

      public Optional<Vm> getVmToMigrate(Host host)
      Description copied from interface: VmSelectionPolicy
      Gets a VM to migrate from a given Host.
      Specified by:
      getVmToMigrate in interface VmSelectionPolicy
      Parameters:
      host - the Host to get a Vm to migrate from
      Returns:
      a Optional containing the selected vm to migrate; or empty Optional if there is not Vm to migrate