cloudsim 学习笔记 实例5(5)
时间:2026-01-16
时间:2026-01-16
cloudsim 学习笔记 实例
int mips=1000;
// 3. Create PEs and add these into a list. 【创建处理器 并添加到Pe列表】
peList.add(new Pe(0, new PeProvisionerSimple(mips))); // need to store Pe id and MIPS Rating 【Pe编号 和 处理速度】
//4. Create Host with its id and list of PEs and add them to the list of machines 【创建主机】
int hostId=0;
int ram = 2048; //host memory (MB)
long storage = 1000000; //host storage
int bw = 10000;
hostList.add(
new Host(
hostId,
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bw),
storage,
peList,
new VmSchedulerSpaceShared(peList) 【虚拟机空间共享】 )
); // This is our first machine
// 5. Create a DatacenterCharacteristics object that stores the 【创建数据中心特征对象】
// properties of a data center: architecture, OS, list of
// Machines, allocation policy: time- or space-shared, time zone
// and its price (G$/Pe time unit).
String arch = "x86"; // system architecture
String os = "Linux"; // operating system
String vmm = "Xen";
double time_zone = 10.0; // time zone this resource located
double cost = 3.0; // the cost of using processing in this resource double costPerMem = 0.05; // the cost of using memory in this resource double costPerStorage = 0.001; // the cost of using storage in this resource double costPerBw = 0.0; // the cost of using bw in this resource
LinkedList<Storage> storageList = new LinkedList<Storage>(); //we are not adding
上一篇:卡罗拉使用手册(1-30)
下一篇:三年级《火鞋与风鞋》阅读课教案