CloudSim3.0.3power编程examples及辅助类解析
注:本文为旧文的markdown重制版
power编程依赖的底层主要类(PowerDataCenter、PowerDCBroker、调度策略类等等)都是org.cloudbus.cloudsim.power包中,这些类在之前的文章中已经介绍:
- Cloudsim 3.0.3中Power系列类的解析——PowerDataCenter和PowerDCBroker
- Cloudsim 3.0.3中Power系列类的解析——PowerHost, PowerVM, PowerModel
- Cloudsim 3.0.3中VM调度策略系列类解析(无迁移的策略)
- Cloudsim 3.0.3中VM调度策略系列类解析(带迁移的策略)
等等
CloudSim3.0.3与power包相关的样例在org.cloudbus.cloudsim.examples.power.random/planetlab中,基本辅助类在org.cloudbus.cloudsim.examples.power中,样例特定的辅助类则与样例存放在一起。
1、基本辅助类
位置:org.cloudbus.cloudsim.examples.power,用于辅助power examples的编写,功能主要包括定义所有常量(如VM类型、host类型、任务类型、调度间隔schedulingInterval等)、创建数据中心、VM等各实验对象和初始化并启动模拟等等。
1.1 org.cloudbus.cloudsim.examples.power.Constants.java
定义了power仿真需要用到的各种常量,重要常量包括:
public final static double SCHEDULING_INTERVAL = 300; //调度间隔,在创建DC时会传入,数据中心在无事件可处理时,会发出delay=SCHEDULING_INTERVAL的事件以将clock向前推演一个间隔。另外,从example代码中看,300秒同时是planetlab.workload负载数据的间隔。
public final static double SIMULATION_LIMIT = 24 * 60 * 60; //仿真模拟时间上限=1天
// length: 2500 mips * 1 day
public final static int CLOUDLET_LENGTH= 2500 * (int) SIMULATION_LIMIT; //云任务的指令长度
public final static int CLOUDLET_PES= 1; //云任务的PE需求
//定义了4种虚拟机,均为单核
public final static int VM_TYPES= 4;
public final static int[] VM_MIPS= { 2500, 2000, 1000, 500 };
public final static int[] VM_PES= { 1, 1, 1, 1 };
public final static int[] VM_RAM= { 870, 1740, 1740, 613 };
public final static int VM

1335

被折叠的 条评论
为什么被折叠?



