Class VmSelectionPolicyRandomSelection
java.lang.Object
org.cloudsimplus.selectionpolicies.VmSelectionPolicyRandomSelection
- All Implemented Interfaces:
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
-
Field Summary
Fields inherited from interface org.cloudsimplus.selectionpolicies.VmSelectionPolicy
NULL -
Constructor Summary
ConstructorsConstructorDescriptionCreates a PowerVmSelectionPolicyRandomSelection using a uniform Pseudo Random Number Generator (PRNG) as default to select VMs to migrate.VmSelectionPolicyRandomSelection(@NonNull ContinuousDistribution rand) Creates a PowerVmSelectionPolicyRandomSelection using a given Pseudo Random Number Generator (PRNG) to select VMs to migrate. -
Method Summary
Modifier and TypeMethodDescriptiongetVmToMigrate(Host host) Gets a VM to migrate from a given Host.
-
Constructor Details
-
VmSelectionPolicyRandomSelection
public VmSelectionPolicyRandomSelection()Creates a PowerVmSelectionPolicyRandomSelection using a uniform Pseudo Random Number Generator (PRNG) as default to select VMs to migrate. -
VmSelectionPolicyRandomSelection
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
Description copied from interface:VmSelectionPolicyGets a VM to migrate from a given Host.- Specified by:
getVmToMigratein interfaceVmSelectionPolicy- Parameters:
host- the Host to get a Vm to migrate from- Returns:
- a
Optionalcontaining the selected vm to migrate; or empty Optional if there is not Vm to migrate
-