cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/allocationpolicies/power/PowerVmAllocationPolicyMigrationAbstract.java
protected Optional<PowerHost> findHostForVmInternal(final Vm vm, final Stream<PowerHost> hostStream){
        final Comparator<PowerHost> hostPowerConsumptionComparator =
            Comparator.comparingDouble(h -> getPowerAfterAllocationDifference(h, vm));

        return additionalHostFilters(vm, hostStream).min(hostPowerConsumptionComparator);
    }
/**
     * Applies additional filters to the Hosts Stream and performs the actual Host selection.
     * This method is a Stream's final operation, that it, it closes the Stream and returns an {@link Optional} value.
     *
     * <p>This method can be overridden by sub-classes to change the method used to select the Host for the given VM.</p>
     *
     * @param vm the VM to find a Host to be placed into
     * @param hostStream a {@link Stream} containing the Hosts after passing the basic filtering
     * @return an {@link Optional} that may or may not contain the Host to place the VM
     * @see #findHostForVm(Vm, Set)
     * @see #additionalHostFilters(Vm, Stream)
     */
Applies additional filters to the Hosts Stream and performs the actual Host selection.
This method is a Stream's final operation, that it, it closes the Stream and returns an  Optional value.

This method can be overridden by sub-classes to change the method used to select the Host for the given VM.


Applies additional filters to the Hosts Stream and performs the actual Host selection . This method is a Stream ' s final operation that it it closes the Stream and returns an Optional value . This method can be overridden by sub - classes to change the method used to select the Host for the given VM .
protected Optional<PowerHost> findHostForVmInternal(final Vm vm, final Stream<PowerHost> hostStream){
        final Comparator<PowerHost> hostPowerConsumptionComparator =
            Comparator.comparingDouble(h -> getPowerAfterAllocationDifference(h, vm));
        return additionalHostFilters(vm, hostStream).min(hostPowerConsumptionComparator);
    }
protected Optional < PowerHost > findHostForVmInternal ( final Vm vm , final Stream < PowerHost > hostStream ) { final Comparator < PowerHost > hostPowerConsumptionComparator = Comparator . comparingDouble ( h -> getPowerAfterAllocationDifference ( h , vm ) ) ; return additionalHostFilters ( vm , hostStream ) . min ( hostPowerConsumptionComparator ) ; }
Applies additional filters to the Hosts Stream and performs the actual Host selection.
Applies additional filters to the Hosts Stream and performs the actual Host selection .