cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/network/applications/NetworkVmExampleAbstract.java
protected List<NetworkVm> randomlySelectVmsForApp(
        DatacenterBroker broker, int numberOfVmsToSelect) {
        List<NetworkVm> list = new ArrayList<>();
        int numOfExistingVms = this.vmList.size();
        UniformDistr rand = new UniformDistr(0, numOfExistingVms, 5);
        for (int i = 0; i < numberOfVmsToSelect; i++) {
            int vmId = (int) rand.sample();
            NetworkVm vm = VmList.getById(this.vmList, vmId);
            if(vm != Vm.NULL){
                list.add(vm);
            }
        }
        return list;
    }
/**
     * Randomly select a given number of VMs from the list of created VMs,
     * to be used by the NetworkCloudlets of the given application.
     *
     * @param broker the broker where to get the existing VM list
     * @param numberOfVmsToSelect number of VMs to selected from the existing list of VMs.
     * @return The list of randomly selected VMs
     */
Randomly select a given number of VMs from the list of created VMs,
to be used by the NetworkCloudlets of the given application.

@param broker the broker where to get the existing VM list
@param numberOfVmsToSelect number of VMs to selected from the existing list of VMs.
@return The list of randomly selected VMs
Randomly select a given number of VMs from the list of created VMs to be used by the NetworkCloudlets of the given application . @param broker the broker where to get the existing VM list @param numberOfVmsToSelect number of VMs to selected from the existing list of VMs . @return The list of randomly selected VMs
protected List<NetworkVm> randomlySelectVmsForApp(
        DatacenterBroker broker, int numberOfVmsToSelect) {
        List<NetworkVm> list = new ArrayList<>();
        int numOfExistingVms = this.vmList.size();
        UniformDistr rand = new UniformDistr(0, numOfExistingVms, 5);
        for (int i = 0; i < numberOfVmsToSelect; i++) {
            int vmId = (int) rand.sample();
            NetworkVm vm = VmList.getById(this.vmList, vmId);
            if(vm != Vm.NULL){
                list.add(vm);
            }
        }
        return list;
    }
protected List < NetworkVm > randomlySelectVmsForApp ( DatacenterBroker broker , int numberOfVmsToSelect ) { List < NetworkVm > list = new ArrayList < > ( ) ; int numOfExistingVms = this . vmList . size ( ) ; UniformDistr rand = new UniformDistr ( 0 , numOfExistingVms , 5 ) ; for ( int i = 0 ; i < numberOfVmsToSelect ; i ++ ) { int vmId = ( int ) rand . sample ( ) ; NetworkVm vm = VmList . getById ( this . vmList , vmId ) ; if ( vm != Vm . NULL ) { list . add ( vm ) ; } } return list ; }
Randomly select a given number of VMs from the list of created VMs,
 to be used by the NetworkCloudlets of the given application.
Randomly select a given number of VMs from the list of created VMs to be used by the NetworkCloudlets of the given application .