当前位置: 首页>>代码示例>>Java>>正文


Java Host.getVmList方法代码示例

本文整理汇总了Java中org.cloudbus.cloudsim.Host.getVmList方法的典型用法代码示例。如果您正苦于以下问题:Java Host.getVmList方法的具体用法?Java Host.getVmList怎么用?Java Host.getVmList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cloudbus.cloudsim.Host的用法示例。


在下文中一共展示了Host.getVmList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCloudletCompletion

import org.cloudbus.cloudsim.Host; //导入方法依赖的package包/类
@Override
protected void checkCloudletCompletion() {
	if(!nos.isApplicationDeployed())
	{
		super.checkCloudletCompletion();
		return;
	}
	
	List<? extends Host> list = getVmAllocationPolicy().getHostList();
	for (int i = 0; i < list.size(); i++) {
		Host host = list.get(i);
		for (Vm vm : host.getVmList()) {
			while (vm.getCloudletScheduler().isFinishedCloudlets()) {
				Cloudlet cl = vm.getCloudletScheduler().getNextFinishedCloudlet();
				if (cl != null) {
					int hostAddress = nos.getHostAddressByVmId(cl.getVmId());
					sendNow(hostAddress, CloudSimTags.CLOUDLET_RETURN, cl);
				}
			}
		}
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:23,代码来源:SDNDatacenter.java

示例2: saveAllocation

import org.cloudbus.cloudsim.Host; //导入方法依赖的package包/类
/**
 * Save allocation.
 */
protected void saveAllocation() {
	getSavedAllocation().clear();
	for (Host host : getHostList()) {
		for (Vm vm : host.getVmList()) {
			if (host.getVmsMigratingIn().contains(vm)) {
				continue;
			}
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("host", host);
			map.put("vm", vm);
			getSavedAllocation().add(map);
		}
	}
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:18,代码来源:PowerVmAllocationPolicyMigrationAbstract.java

示例3: checkCloudletCompletion

import org.cloudbus.cloudsim.Host; //导入方法依赖的package包/类
protected void checkCloudletCompletion() {
	boolean cloudletCompleted = false;
	List<? extends Host> list = getVmAllocationPolicy().getHostList();
	for (int i = 0; i < list.size(); i++) {
		Host host = list.get(i);
		for (Vm vm : host.getVmList()) {
			while (vm.getCloudletScheduler().isFinishedCloudlets()) {
				Cloudlet cl = vm.getCloudletScheduler().getNextFinishedCloudlet();
				if (cl != null) {
					
					cloudletCompleted = true;
					Tuple tuple = (Tuple)cl;
					TimeKeeper.getInstance().tupleEndedExecution(tuple);
					Application application = getApplicationMap().get(tuple.getAppId());
					Logger.debug(getName(), "Completed execution of tuple "+tuple.getCloudletId()+"on "+tuple.getDestModuleName());
					List<Tuple> resultantTuples = application.getResultantTuples(tuple.getDestModuleName(), tuple, getId(), vm.getId());
					for(Tuple resTuple : resultantTuples){
						resTuple.setModuleCopyMap(new HashMap<String, Integer>(tuple.getModuleCopyMap()));
						resTuple.getModuleCopyMap().put(((AppModule)vm).getName(), vm.getId());
						updateTimingsOnSending(resTuple);
						sendToSelf(resTuple);
					}
					sendNow(cl.getUserId(), CloudSimTags.CLOUDLET_RETURN, cl);
				}
			}
		}
	}
	if(cloudletCompleted)
		updateAllocatedMips(null);
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:31,代码来源:FogDevice.java


注:本文中的org.cloudbus.cloudsim.Host.getVmList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。