cloudsim-plus-master/VmAllocationPSOResearch/src/org/cloudbus/cloudsim/allocationpolicies/Test.java
private List<Cloudlet> createCloudlets() {
	    	int count=0;
	    	int[] cLength= {107565, 27990, 20625, 19190, 17855, 16612, 31942, 27349, 23417, 20050, 1559, 1538, 1518, 1498, 22236, 17872, 14364, 11545, 3208, 2990, 2787, 2598, 7393, 5861, 4647, 3685, 2921, 2316, 491, 464, 438, 414, 391, 369, 248, 238, 229, 220, 211, 203, 276, 260, 246, 232, 219, 207, 635, 520, 426, 1932};
	        final List<Cloudlet> list = new ArrayList<>(); //Put Cloudlet list here
	        for(int i=0; i<this.CLOUDLETS;i++) {
	        	Cloudlet cloudlet =
		                new CloudletSimple(i, cLength[i], CLOUDLET_PES)
		                    .setFileSize(1024)
		                    .setOutputSize(1024)
		                    .setUtilizationModel(new UtilizationModelFull());
	        	list.add(cloudlet);
	        	count++;
	        }
	        System.out.print("\ncount cloudlet: "+count);
	    	/*final List<Cloudlet> list = new ArrayList<>();
	        UtilizationModel utilization = new UtilizationModelFull();
	        long taskLength =this.CLOUDLET_LENGTH;
	        int cloudletNo = this.CLOUDLETS;
	        int i=0;
	        while (taskLength >0) {
	        	System.out.println("TaskLength" + taskLength);
	        	
	        	if(i<cloudletNo-1 && taskLength>=10)	{
	        		//long  length = (long)(Math.random()*taskLength);
	        		UniformDistr rand = new UniformDistr (0, taskLength);
	        		long length = (long)(rand.sample()/25);
		        	while (length ==0) {
		        		length = (long)(rand.sample()/25);
		        	}
		        	Cloudlet cloudlet =
		                new CloudletSimple(i, length, CLOUDLET_PES)
		                    .setFileSize(1024)
		                    .setOutputSize(1024)
		                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length;
	        		
	        		System.out.println("process"+length);
	        	}else if(i==cloudletNo || taskLength<10) {
	        		long length1 = taskLength;
	        		Cloudlet cloudlet =
	                new CloudletSimple(i, length1, CLOUDLET_PES)
	                    .setFileSize(1024)
	                    .setOutputSize(1024)
	                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length1;
	        		System.out.println("process"+length1);
	        	}
	        	
	            
	        i++;
	        
	        //cloudletNo--;
	        }*/
	        return list;
	    }
/**
	     * Creates a list of Cloudlets.
	     */
Creates a list of Cloudlets.
Creates a list of Cloudlets .
private List<Cloudlet> createCloudlets() {
	    	int count=0;
	    	int[] cLength= {107565, 27990, 20625, 19190, 17855, 16612, 31942, 27349, 23417, 20050, 1559, 1538, 1518, 1498, 22236, 17872, 14364, 11545, 3208, 2990, 2787, 2598, 7393, 5861, 4647, 3685, 2921, 2316, 491, 464, 438, 414, 391, 369, 248, 238, 229, 220, 211, 203, 276, 260, 246, 232, 219, 207, 635, 520, 426, 1932};
	        final List<Cloudlet> list = new ArrayList<>(); 
	        for(int i=0; i<this.CLOUDLETS;i++) {
	        	Cloudlet cloudlet =
		                new CloudletSimple(i, cLength[i], CLOUDLET_PES)
		                    .setFileSize(1024)
		                    .setOutputSize(1024)
		                    .setUtilizationModel(new UtilizationModelFull());
	        	list.add(cloudlet);
	        	count++;
	        }
	        System.out.print("\ncount cloudlet: "+count);
	    	/*final List<Cloudlet> list = new ArrayList<>();
	        UtilizationModel utilization = new UtilizationModelFull();
	        long taskLength =this.CLOUDLET_LENGTH;
	        int cloudletNo = this.CLOUDLETS;
	        int i=0;
	        while (taskLength >0) {
	        	System.out.println("TaskLength" + taskLength);
	        	if(i<cloudletNo-1 && taskLength>=10)	{
	        		//long  length = (long)(Math.random()*taskLength);
	        		UniformDistr rand = new UniformDistr (0, taskLength);
	        		long length = (long)(rand.sample()/25);
		        	while (length ==0) {
		        		length = (long)(rand.sample()/25);
		        	}
		        	Cloudlet cloudlet =
		                new CloudletSimple(i, length, CLOUDLET_PES)
		                    .setFileSize(1024)
		                    .setOutputSize(1024)
		                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length;
	        		System.out.println("process"+length);
	        	}else if(i==cloudletNo || taskLength<10) {
	        		long length1 = taskLength;
	        		Cloudlet cloudlet =
	                new CloudletSimple(i, length1, CLOUDLET_PES)
	                    .setFileSize(1024)
	                    .setOutputSize(1024)
	                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length1;
	        		System.out.println("process"+length1);
	        	}
	        i++;
	        //cloudletNo--;
	        }*/
	        return list;
	    }
private List < Cloudlet > createCloudlets ( ) { int count = 0 ; int [ ] cLength = { 107565 , 27990 , 20625 , 19190 , 17855 , 16612 , 31942 , 27349 , 23417 , 20050 , 1559 , 1538 , 1518 , 1498 , 22236 , 17872 , 14364 , 11545 , 3208 , 2990 , 2787 , 2598 , 7393 , 5861 , 4647 , 3685 , 2921 , 2316 , 491 , 464 , 438 , 414 , 391 , 369 , 248 , 238 , 229 , 220 , 211 , 203 , 276 , 260 , 246 , 232 , 219 , 207 , 635 , 520 , 426 , 1932 } ; final List < Cloudlet > list = new ArrayList < > ( ) ; for ( int i = 0 ; i < this . CLOUDLETS ; i ++ ) { Cloudlet cloudlet = new CloudletSimple ( i , cLength [ i ] , CLOUDLET_PES ) . setFileSize ( 1024 ) . setOutputSize ( 1024 ) . setUtilizationModel ( new UtilizationModelFull ( ) ) ; list . add ( cloudlet ) ; count ++ ; } System . out . print ( "\ncount cloudlet: " + count ) ; /*final List<Cloudlet> list = new ArrayList<>();
	        UtilizationModel utilization = new UtilizationModelFull();
	        long taskLength =this.CLOUDLET_LENGTH;
	        int cloudletNo = this.CLOUDLETS;
	        int i=0;
	        while (taskLength >0) {
	        	System.out.println("TaskLength" + taskLength);
	        	
	        	if(i<cloudletNo-1 && taskLength>=10)	{
	        		//long  length = (long)(Math.random()*taskLength);
	        		UniformDistr rand = new UniformDistr (0, taskLength);
	        		long length = (long)(rand.sample()/25);
		        	while (length ==0) {
		        		length = (long)(rand.sample()/25);
		        	}
		        	Cloudlet cloudlet =
		                new CloudletSimple(i, length, CLOUDLET_PES)
		                    .setFileSize(1024)
		                    .setOutputSize(1024)
		                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length;
	        		
	        		System.out.println("process"+length);
	        	}else if(i==cloudletNo || taskLength<10) {
	        		long length1 = taskLength;
	        		Cloudlet cloudlet =
	                new CloudletSimple(i, length1, CLOUDLET_PES)
	                    .setFileSize(1024)
	                    .setOutputSize(1024)
	                    .setUtilizationModel(utilization);
	        		list.add(cloudlet);
	        		taskLength= taskLength - length1;
	        		System.out.println("process"+length1);
	        	}
	        	
	            
	        i++;
	        
	        //cloudletNo--;
	        }*/ return list ; }
Creates a list of Cloudlets.
Creates a list of Cloudlets .
//Put Cloudlet list here