cloudsim-plus-master/VmAllocationPSOResearch/src/org/cloudbus/cloudsim/allocationpolicies/trial.java
private List<PowerVm> createPowerVms() {
	        final List<PowerVm> list = new ArrayList<>(VMS);
	        for (int i = 0; i < VMS; i++) {
	        	PowerVm vm;
	        	if(i%3==0) { // type1
	        		vm = new PowerVm(i, 30, VM_PES);
	        		vm.setRam(613).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}else if(i%3==1) { //type2
	        		vm = new PowerVm(i, 40, VM_PES);
	        		vm.setRam(870).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}else {  //type3
	        		vm = new PowerVm(i, 50, VM_PES);
	        		vm.setRam(1740).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}
	            
	            list.add(vm);
	        }
	        //System.out.println("vmList from test: "+list);
	        return list;
	    }
/**
	     * Creates a list of VMs.
	     */
Creates a list of VMs.
Creates a list of VMs .
private List<PowerVm> createPowerVms() {
	        final List<PowerVm> list = new ArrayList<>(VMS);
	        for (int i = 0; i < VMS; i++) {
	        	PowerVm vm;
	        	if(i%3==0) { 
	        		vm = new PowerVm(i, 30, VM_PES);
	        		vm.setRam(613).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}else if(i%3==1) { 
	        		vm = new PowerVm(i, 40, VM_PES);
	        		vm.setRam(870).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}else {  
	        		vm = new PowerVm(i, 50, VM_PES);
	        		vm.setRam(1740).setBw(100).setSize(256)
	              .setCloudletScheduler(new CloudletSchedulerTimeShared());
	        	}
	            list.add(vm);
	        }
	        return list;
	    }
private List < PowerVm > createPowerVms ( ) { final List < PowerVm > list = new ArrayList < > ( VMS ) ; for ( int i = 0 ; i < VMS ; i ++ ) { PowerVm vm ; if ( i % 3 == 0 ) { vm = new PowerVm ( i , 30 , VM_PES ) ; vm . setRam ( 613 ) . setBw ( 100 ) . setSize ( 256 ) . setCloudletScheduler ( new CloudletSchedulerTimeShared ( ) ) ; } else if ( i % 3 == 1 ) { vm = new PowerVm ( i , 40 , VM_PES ) ; vm . setRam ( 870 ) . setBw ( 100 ) . setSize ( 256 ) . setCloudletScheduler ( new CloudletSchedulerTimeShared ( ) ) ; } else { vm = new PowerVm ( i , 50 , VM_PES ) ; vm . setRam ( 1740 ) . setBw ( 100 ) . setSize ( 256 ) . setCloudletScheduler ( new CloudletSchedulerTimeShared ( ) ) ; } list . add ( vm ) ; } return list ; }
Creates a list of VMs.
Creates a list of VMs .
// type1 //type2 //type3 //System.out.println("vmList from test: "+list);