cloudsim 学习笔记 实例5(4)
时间:2026-01-16
时间:2026-01-16
cloudsim 学习笔记 实例
cloudletList2.add(cloudlet2); //submit cloudlet list to the brokers 【云任务列表提交给代理】 broker1.submitCloudletList(cloudletList1); broker2.submitCloudletList(cloudletList2);
【比较例子4 没有了bind the cloudlets to the vms !!!】
// Sixth step: Starts the simulation 【开始仿真】
CloudSim.startSimulation();
// Final step: Print results when simulation is over 【仿真结束 打印结果】 List<Cloudlet> newList1 = broker1.getCloudletReceivedList();
List<Cloudlet> newList2 = broker2.getCloudletReceivedList();
CloudSim.stopSimulation();
Log.print("=============> User "+brokerId1+" ");
printCloudletList(newList1);
Log.print("=============> User "+brokerId2+" ");
printCloudletList(newList2);
//Print the debt of each user to each datacenter 【打印账单】
datacenter0.printDebts();
datacenter1.printDebts();
Log.printLine("CloudSimExample5 finished!");
}
catch (Exception e) {
e.printStackTrace();
Log.printLine("Unwanted errors happen");
}
}
private static Datacenter createDatacenter(String name){
// Here are the steps needed to create a PowerDatacenter:
// 1. We need to create a list to store 【创建列表储存机器】
// our machine
List<Host> hostList = new ArrayList<Host>();
// 2. A Machine contains one or more PEs or CPUs/Cores.
// In this example, it will have only one core.
List<Pe> peList = new ArrayList<Pe>();
上一篇:卡罗拉使用手册(1-30)
下一篇:三年级《火鞋与风鞋》阅读课教案