cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudbus/cloudsim/examples/power/util/PlanetLabRunner.java
public static List<Cloudlet> createCloudletListPlanetLab(DatacenterBroker broker, String inputFolderName) {
final long fileSize = 300;
        final long outputSize = 300;

final File inputFolder = new File(inputFolderName);
final File[] files = inputFolder.listFiles();
if(Objects.isNull(files)) {
return new ArrayList<>();
}

final int filesToRead = Math.min(files.length, MAX_NUMBER_OF_WORLOAD_FILES_TO_READ);
final List<Cloudlet> list = new ArrayList<>(filesToRead);
        for (int i = 0; i < filesToRead; i++) {
            try {
UtilizationModel utilizationModelCPU =
new UtilizationModelPlanetLab(
                                files[i].getAbsolutePath(),
                                Constants.SCHEDULING_INTERVAL);
                CloudletSimple cloudlet = new CloudletSimple(
i, Constants.CLOUDLET_LENGTH, Constants.CLOUDLET_PES);
                cloudlet.setFileSize(fileSize)
.setOutputSize(outputSize)
                        .setUtilizationModelCpu(utilizationModelCPU);
//cloudlet.setVm(i);
list.add(cloudlet);
            } catch (Exception e) {
                e.printStackTrace();
                System.exit(0);
            }
        }

        return list;
    }
/**
     * Creates the cloudlet list planet lab.
     *
     * @param broker the broker
     * @param inputFolderName the input folder name
     * @return the list
     */
Creates the cloudlet list planet lab.
@param broker the broker
@param inputFolderName the input folder name
@return the list
Creates the cloudlet list planet lab . @param broker the broker @param inputFolderName the input folder name @return the list
public static List<Cloudlet> createCloudletListPlanetLab(DatacenterBroker broker, String inputFolderName) {
final long fileSize = 300;
        final long outputSize = 300;
final File inputFolder = new File(inputFolderName);
final File[] files = inputFolder.listFiles();
if(Objects.isNull(files)) {
return new ArrayList<>();
}
final int filesToRead = Math.min(files.length, MAX_NUMBER_OF_WORLOAD_FILES_TO_READ);
final List<Cloudlet> list = new ArrayList<>(filesToRead);
        for (int i = 0; i < filesToRead; i++) {
            try {
UtilizationModel utilizationModelCPU =
new UtilizationModelPlanetLab(
                                files[i].getAbsolutePath(),
                                Constants.SCHEDULING_INTERVAL);
                CloudletSimple cloudlet = new CloudletSimple(
i, Constants.CLOUDLET_LENGTH, Constants.CLOUDLET_PES);
                cloudlet.setFileSize(fileSize)
.setOutputSize(outputSize)
                        .setUtilizationModelCpu(utilizationModelCPU);
list.add(cloudlet);
            } catch (Exception e) {
                e.printStackTrace();
                System.exit(0);
            }
        }
        return list;
    }
public static List < Cloudlet > createCloudletListPlanetLab ( DatacenterBroker broker , String inputFolderName ) { final long fileSize = 300 ; final long outputSize = 300 ; final File inputFolder = new File ( inputFolderName ) ; final File [ ] files = inputFolder . listFiles ( ) ; if ( Objects . isNull ( files ) ) { return new ArrayList < > ( ) ; } final int filesToRead = Math . min ( files . length , MAX_NUMBER_OF_WORLOAD_FILES_TO_READ ) ; final List < Cloudlet > list = new ArrayList < > ( filesToRead ) ; for ( int i = 0 ; i < filesToRead ; i ++ ) { try { UtilizationModel utilizationModelCPU = new UtilizationModelPlanetLab ( files [ i ] . getAbsolutePath ( ) , Constants . SCHEDULING_INTERVAL ) ; CloudletSimple cloudlet = new CloudletSimple ( i , Constants . CLOUDLET_LENGTH , Constants . CLOUDLET_PES ) ; cloudlet . setFileSize ( fileSize ) . setOutputSize ( outputSize ) . setUtilizationModelCpu ( utilizationModelCPU ) ; list . add ( cloudlet ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . exit ( 0 ) ; } } return list ; }
Creates the cloudlet list planet lab.
Creates the cloudlet list planet lab .
//cloudlet.setVm(i);