本文整理汇总了Java中org.cloudbus.cloudsim.Cloudlet.getVmId方法的典型用法代码示例。如果您正苦于以下问题:Java Cloudlet.getVmId方法的具体用法?Java Cloudlet.getVmId怎么用?Java Cloudlet.getVmId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cloudbus.cloudsim.Cloudlet
的用法示例。
在下文中一共展示了Cloudlet.getVmId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRequest
import org.cloudbus.cloudsim.Cloudlet; //导入方法依赖的package包/类
private void processRequest(Request req) {//Request received from user. Send to SdnHost
Activity ac = req.getNextActivity();
if(ac instanceof Processing) {
Cloudlet cl = ((Processing) ac).getCloudlet();
int hostAddress = nos.getHostAddressByVmId(cl.getVmId());
//for this first package, size doesn't matter
Package pkg = new Package(super.getId(), cl.getVmId(), -1, -1, req);
sendNow(hostAddress, Constants.SDN_PACKAGE, pkg);
}
else {
System.err.println("Request should start with Processing!!");
}
}
示例2: processNextActivityProcessing
import org.cloudbus.cloudsim.Cloudlet; //导入方法依赖的package包/类
private void processNextActivityProcessing(Processing proc, Request reqAfterCloudlet) {
Cloudlet cl = proc.getCloudlet();
requestsTable.put(cl.getCloudletId(), reqAfterCloudlet);
sendNow(getId(), CloudSimTags.CLOUDLET_SUBMIT, cl);
// Set the requested MIPS for this cloudlet.
int userId = cl.getUserId();
int vmId = cl.getVmId();
Host host = getVmAllocationPolicy().getHost(vmId, userId);
Vm vm = host.getVm(vmId, userId);
double mips = vm.getMips();
proc.setVmMipsPerPE(mips);
}