本文整理汇总了Java中org.cloudbus.cloudsim.power.PowerVm类的典型用法代码示例。如果您正苦于以下问题:Java PowerVm类的具体用法?Java PowerVm怎么用?Java PowerVm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PowerVm类属于org.cloudbus.cloudsim.power包,在下文中一共展示了PowerVm类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createVmList
import org.cloudbus.cloudsim.power.PowerVm; //导入依赖的package包/类
/**
* Creates the vm list.
*
* @param brokerId the broker id
* @param vmsNumber the vms number
*
* @return the list< vm>
*/
public static List<Vm> createVmList(int brokerId, int vmsNumber) {
List<Vm> vms = new ArrayList<Vm>();
for (int i = 0; i < vmsNumber; i++) {
int vmType = i / (int) Math.ceil((double) vmsNumber / Constants.VM_TYPES);
vms.add(new PowerVm(
i,
brokerId,
Constants.VM_MIPS[vmType],
Constants.VM_PES[vmType],
Constants.VM_RAM[vmType],
Constants.VM_BW,
Constants.VM_SIZE,
1,
"Xen",
new CloudletSchedulerDynamicWorkload(Constants.VM_MIPS[vmType], Constants.VM_PES[vmType]),
Constants.SCHEDULING_INTERVAL));
}
return vms;
}
示例2: createVmList
import org.cloudbus.cloudsim.power.PowerVm; //导入依赖的package包/类
/**
* Creates the vm list.
*
* @param brokerId the broker id
* @param vmsNumber the vms number
*
* @return the list< vm>
*/
public static List<Vm> createVmList(int brokerId, int vmsNumber) {
List<Vm> vms = new ArrayList<Vm>();
//大致的随机生成一些VM,VM所拥有的配置不特别相同
for (int i = 0; i < vmsNumber; i++) {
int vmType = i / (int) Math.ceil((double) vmsNumber / Constants.VM_TYPES);//VM_TYPES = 4
vms.add(new PowerVm(
i,
brokerId,
Constants.VM_MIPS[vmType],
Constants.VM_PES[vmType],
Constants.VM_RAM[vmType],
Constants.VM_BW,
Constants.VM_SIZE, // 磁盘容量大小
1,
"Xen",
new CloudletSchedulerDynamicWorkload(Constants.VM_MIPS[vmType], Constants.VM_PES[vmType]),
Constants.SCHEDULING_INTERVAL));
}
return vms;
}
示例3: createVmList
import org.cloudbus.cloudsim.power.PowerVm; //导入依赖的package包/类
/**
* Creates the vm list.
*
* @param vmsNumber
* the vms number
*/
public void createVmList(int vmsNumber) {
for (int i = 1; i <= vmsNumber; i++) {
vmlist.add(new PowerVm(i, broker.getId(), MyConstants.VM_MIPS, MyConstants.VM_PES_NUMBER,
MyConstants.VM_RAM, MyConstants.VM_BW, MyConstants.VM_SIZE, MyConstants.VM_PRIORITY,
MyConstants.VM_VMM, MyConstants.VM_CLOUDLET_SCHEDULER, MyConstants.VM_SCHEDULING_INTERVVAL));
}
broker.submitVmList(vmlist);
}