cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudsimplus/heuristics/CloudletToVmMappingSolution.java
protected boolean swapVmsOfTwoMapEntries(Map.Entry<Cloudlet, Vm>... entries) {
        if(Objects.isNull(entries) || entries.length != 2 || Objects.isNull(entries[0]) || Objects.isNull(entries[1]))
            return false;

        final Vm vm1 = entries[0].getValue();
        final Vm vm2 = entries[1].getValue();
        entries[0].setValue(vm2);
        entries[1].setValue(vm1);

        return true;
    }
/**
     * Swap the Vm's of 2 randomly selected cloudlets
     * in the {@link #cloudletVmMap} in order to
     * provide a neighbor solution.
     *
     * The method change the given Map entries, moving the
     * cloudlet of the first entry to the Vm of the second entry
     * and vice-versa.
     *
     * @param entries an array of 2 entries that the Vm of their cloudlets should
     * be swapped. If the entries don't have 2 elements, the method will
     * return without performing any change in the entries.
     * @return true if the Cloudlet's VMs where swapped, false otherwise
     */
Swap the Vm's of 2 randomly selected cloudlets
in the  #cloudletVmMap in order to
provide a neighbor solution.

The method change the given Map entries, moving the
cloudlet of the first entry to the Vm of the second entry
and vice-versa.

@param entries an array of 2 entries that the Vm of their cloudlets should
be swapped. If the entries don't have 2 elements, the method will
return without performing any change in the entries.
@return true if the Cloudlet's VMs where swapped, false otherwise
Swap the Vm ' s of 2 randomly selected cloudlets in the #cloudletVmMap in order to provide a neighbor solution . The method change the given Map entries moving the cloudlet of the first entry to the Vm of the second entry and vice - versa . @param entries an array of 2 entries that the Vm of their cloudlets should be swapped . If the entries don ' t have 2 elements the method will return without performing any change in the entries . @return true if the Cloudlet ' s VMs where swapped false otherwise
protected boolean swapVmsOfTwoMapEntries(Map.Entry<Cloudlet, Vm>... entries) {
        if(Objects.isNull(entries) || entries.length != 2 || Objects.isNull(entries[0]) || Objects.isNull(entries[1]))
            return false;
        final Vm vm1 = entries[0].getValue();
        final Vm vm2 = entries[1].getValue();
        entries[0].setValue(vm2);
        entries[1].setValue(vm1);
        return true;
    }
protected boolean swapVmsOfTwoMapEntries ( Map . Entry < Cloudlet , Vm > ... entries ) { if ( Objects . isNull ( entries ) || entries . length != 2 || Objects . isNull ( entries [ 0 ] ) || Objects . isNull ( entries [ 1 ] ) ) return false ; final Vm vm1 = entries [ 0 ] . getValue ( ) ; final Vm vm2 = entries [ 1 ] . getValue ( ) ; entries [ 0 ] . setValue ( vm2 ) ; entries [ 1 ] . setValue ( vm1 ) ; return true ; }
Swap the Vm's of 2 randomly selected cloudlets
 in the {@link #cloudletVmMap} in order to
 provide a neighbor solution.
Swap the Vm ' s of 2 randomly selected cloudlets in the { @link #cloudletVmMap } in order to provide a neighbor solution .