• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResCloudlet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.cloudbus.cloudsim.ResCloudlet的典型用法代码示例。如果您正苦于以下问题:Java ResCloudlet类的具体用法?Java ResCloudlet怎么用?Java ResCloudlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResCloudlet类属于org.cloudbus.cloudsim包,在下文中一共展示了ResCloudlet类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: NetworkCloudletSpaceSharedScheduler

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
/**
 * Creates a new CloudletSchedulerSpaceShared object. This method must be invoked before
 * starting the actual simulation.
 * 
 * @pre $none
 * @post $none
 */
public NetworkCloudletSpaceSharedScheduler() {
	super();
	cloudletWaitingList = new ArrayList<ResCloudlet>();
	cloudletExecList = new ArrayList<ResCloudlet>();
	cloudletPausedList = new ArrayList<ResCloudlet>();
	cloudletFinishedList = new ArrayList<ResCloudlet>();
	usedPes = 0;
	currentCpus = 0;
	pkttosend = new HashMap<Integer, List<HostPacket>>();
	pktrecv = new HashMap<Integer, List<HostPacket>>();
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:19,代码来源:NetworkCloudletSpaceSharedScheduler.java


示例2: cloudletFinish

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
/**
 * Processes a finished cloudlet.
 * 
 * @param rcl finished cloudlet
 * @pre rgl != $null
 * @post $none
 */
@Override
public void cloudletFinish(ResCloudlet rcl) {
	rcl.setCloudletStatus(Cloudlet.SUCCESS);
	rcl.finalizeCloudlet();
	getCloudletFinishedList().add(rcl);
	usedPes -= rcl.getNumberOfPes();
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:15,代码来源:NetworkCloudletSpaceSharedScheduler.java


示例3: getTotalUtilizationOfCpu

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
/**
 * Get utilization created by all cloudlets.
 * 
 * @param time the time
 * @return total utilization
 */
@Override
public double getTotalUtilizationOfCpu(double time) {
	double totalUtilization = 0;
	for (ResCloudlet gl : getCloudletExecList()) {
		totalUtilization += gl.getCloudlet().getUtilizationOfCpu(time);
	}
	return totalUtilization;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:15,代码来源:NetworkCloudletSpaceSharedScheduler.java


示例4: migrateCloudlet

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
/**
 * Returns one cloudlet to migrate to another vm.
 * 
 * @return one running cloudlet
 * @pre $none
 * @post $none
 */
@Override
public Cloudlet migrateCloudlet() {
	ResCloudlet rcl = getCloudletExecList().remove(0);
	rcl.finalizeCloudlet();
	Cloudlet cl = rcl.getCloudlet();
	usedPes -= cl.getNumberOfPes();
	return cl;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:16,代码来源:NetworkCloudletSpaceSharedScheduler.java


示例5: getTotalCurrentAvailableMipsForCloudlet

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
@Override
public double getTotalCurrentAvailableMipsForCloudlet(ResCloudlet rcl, List<Double> mipsShare) {
	double capacity = 0.0;
	int cpus = 0;
	for (Double mips : mipsShare) { // count the cpus available to the vmm
		capacity += mips;
		if (mips > 0) {
			cpus++;
		}
	}
	currentCpus = cpus;
	capacity /= cpus; // average capacity of each cpu
	return capacity;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:15,代码来源:NetworkCloudletSpaceSharedScheduler.java


示例6: getPositionById

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
/**
 * Returns the position of the cloudlet with that id, if it exists. Otherwise -1.
 * @param cloudletList - the list of cloudlets.
 * @param id - the id we search for.
 * @return - the position of the cloudlet with that id, or -1 otherwise.
 */
public static <T extends ResCloudlet> int getPositionById(List<T> cloudletList, int id) {
	int i = 0 ;
        for (T cloudlet : cloudletList) {
		if (cloudlet.getCloudletId() == id) {
			return i;
		}
		i++;
	}
	return -1;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:17,代码来源:ResCloudletList.java


示例7: getTotalProcessingPreviousTime

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
@Override
public long getTotalProcessingPreviousTime(double currentTime, List<Double> mipsShare) {
	long totalProcessedMIs = 0;
	double timeSpent = currentTime - prevMonitoredTime;
	double capacity = getCapacity(mipsShare);
	
	for (ResCloudlet rcl : getCloudletExecList()) {
		totalProcessedMIs += (long) (capacity * timeSpent * rcl.getNumberOfPes() * Consts.MILLION);
	}
	
	prevMonitoredTime = currentTime;
	return totalProcessedMIs;
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:14,代码来源:CloudletSchedulerSpaceSharedMonitor.java


示例8: getTotalProcessingPreviousTime

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
public long getTotalProcessingPreviousTime(double currentTime, List<Double> mipsShare) {
	long totalProcessedMIs = 0;
	double timeSpent = currentTime - prevMonitoredTime;
	double capacity = getCapacity(mipsShare);
	
	for (ResCloudlet rcl : getCloudletExecList()) {
		totalProcessedMIs += (long) (capacity * timeSpent * rcl.getNumberOfPes() * Consts.MILLION);
	}
	
	prevMonitoredTime = currentTime;
	return totalProcessedMIs;
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:13,代码来源:CloudletSchedulerTimeSharedMonitor.java


示例9: getCloudletTotalPesRequested

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
@Override
public int getCloudletTotalPesRequested() {
	int pesInUse = 0;
	for (ResCloudlet rcl : getCloudletExecList()) {
		pesInUse += rcl.getNumberOfPes();
	}
	return pesInUse;
}
 
开发者ID:jayjmin,项目名称:cloudsimsdn,代码行数:9,代码来源:CloudletSchedulerTimeSharedMonitor.java


示例10: cloudletResume

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
@Override
public double cloudletResume(int cloudletId) {
	boolean found = false;
	int position = 0;

	// look for the cloudlet in the paused list
	for (ResCloudlet rcl : getCloudletPausedList()) {
		if (rcl.getCloudletId() == cloudletId) {
			found = true;
			break;
		}
		position++;
	}

	if (found) {
		ResCloudlet rgl = getCloudletPausedList().remove(position);
		rgl.setCloudletStatus(Cloudlet.INEXEC);
		getCloudletExecList().add(rgl);

		double estimatedFinishTime = Double.MAX_VALUE;
		double assignedResources = assignResources(rgl);

		if (assignedResources > 0) {
			estimatedFinishTime = CloudSim.clock() + rgl.getRemainingCloudletLength() / assignedResources;
		}

		return estimatedFinishTime;
	}

	return 0.0;
}
 
开发者ID:marcbux,项目名称:dynamiccloudsim,代码行数:32,代码来源:CloudletSchedulerGreedyDivided.java


示例11: getTotalCurrentAvailableMipsForCloudlet

import org.cloudbus.cloudsim.ResCloudlet; //导入依赖的package包/类
@Override
public double getTotalCurrentAvailableMipsForCloudlet(ResCloudlet rcl, List<Double> mipsShare) {
	double availableMiTemp = mips.get(0);
	double availableIoTemp = iops.get(0);
	double availableBwTemp = bwps.get(0);
	double assignedResources = assignResources(rcl);
	mips.set(0, availableMiTemp);
	iops.set(0, availableIoTemp);
	bwps.set(0, availableBwTemp);
	return assignedResources;
}
 
开发者ID:marcbux,项目名称:dynamiccloudsim,代码行数:12,代码来源:CloudletSchedulerGreedyDivided.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobInitedEvent类代码示例发布时间:2022-05-22
下一篇:
Java PositionedByteRange类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap