Open norhan-tarek opened 6 years ago
you have to import the source code as an existing maven project. Then there wont be any errors. https://www.youtube.com/watch?v=r38GAwmPmm8
You need to changes for example utilizationModelNull/Full , Number Cloudlets , SchedulerAlg and do not forget adding workload/planetlab to your current project so that you can see workload packages in IDE Projects Explorer
public static List<ContainerCloudlet> createContainerCloudletList(int brokerId, int numberOfCloudlets)
throws FileNotFoundException {
String inputFolderName = ContainerCloudSimExample1.class.getClassLoader().getResource("workload/planetlab").getPath();
ArrayList<ContainerCloudlet> cloudletList = new ArrayList<ContainerCloudlet>();
long fileSize = 300L;
long outputSize = 300L;
UtilizationModelNull utilizationModelNull = new UtilizationModelNull();
java.io.File inputFolder1 = new java.io.File(inputFolderName);
java.io.File[] files1 = inputFolder1.listFiles();
int createdCloudlets = 0;
for (java.io.File aFiles1 : files1) {
java.io.File inputFolder = new java.io.File(aFiles1.toString());
java.io.File[] files = inputFolder.listFiles();
for (int i = 0; i < files.length; ++i) {
if (createdCloudlets < numberOfCloudlets) {
ContainerCloudlet cloudlet = null;
try {
cloudlet = new ContainerCloudlet(IDs.pollId(ContainerCloudlet.class), WFCConstants.CLOUDLET_LENGTH, 1,
fileSize, outputSize,
new UtilizationModelPlanetLabInMemoryExtended(files[i].getAbsolutePath(), 300.0D),
utilizationModelNull, utilizationModelNull);
} catch (Exception var13) {
var13.printStackTrace();
System.exit(0);
}
cloudlet.setUserId(brokerId);
cloudletList.add(cloudlet);
createdCloudlets += 1;
} else {
return cloudletList;
}
}
}
return cloudletList;
}
I have the same problem that you talk about here. and unfortunately I could not solve it yet, would you plz tell me how you solve it
Starting ContainerCloudSimExample1... Initialising... java.lang.NullPointerException Unwanted errors happen atorg.cloudbus.cloudsim.examples.container.ContainerCloudSimExample1.createContainerCloudletList(ContainerCloudSimExample1.java:419) atorg.cloudbus.cloudsim.examples.container.ContainerCloudSimExample1.main(ContainerCloudSimExample1.java:158)
error in eclipes