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

Java HostList类代码示例

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

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



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

示例1: getMips

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource.
 * <p>
 * Total MIPS rating for:
 * <ul>
 * <li>TimeShared = 1 Rating of a Pe * Total number of PEs
 * <li>Other policy same rating = same as TimeShared
 * <li>SpaceShared = Sum of all PEs in all Machines
 * <li>Other policy different rating = same as SpaceShared
 * <li>Advance Reservation = 0 or unknown. You need to calculate this manually.
 * </ul>
 * 
 * @return the sum of MIPS ratings
 * @pre $none
 * @post $result >= 0
 */
public int getMips() {
	int mips = 0;
	switch (getAllocationPolicy()) {
	// Assuming all PEs in all Machine have same rating.
		case DatacenterCharacteristics.TIME_SHARED:
		case DatacenterCharacteristics.OTHER_POLICY_SAME_RATING:
			mips = getMipsOfOnePe() * HostList.getNumberOfPes(getHostList());
			break;

		// Assuming all PEs in a given Machine have the same rating.
		// But different machines in a Cluster can have different rating
		case DatacenterCharacteristics.SPACE_SHARED:
		case DatacenterCharacteristics.OTHER_POLICY_DIFFERENT_RATING:
			for (Host host : getHostList()) {
				mips += host.getTotalMips();
			}
			break;

		default:
			break;
	}

	return mips;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:41,代码来源:DatacenterCharacteristics.java


示例2: getMips

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource.
 * <p>
 * Total MIPS rating for:
 * <ul>
 * <li>TimeShared = 1 Rating of a Pe * Total number of PEs
 * <li>Other policy same rating = same as TimeShared
 * <li>SpaceShared = Sum of all PEs in all Machines
 * <li>Other policy different rating = same as SpaceShared
 * <li>Advance Reservation = 0 or unknown. You need to calculate this manually.
 * </ul>
 * 
 * @return the sum of MIPS ratings
 * @pre $none
 * @post $result >= 0
 */
public int getMips() {
	int mips = 0;
	switch (getAllocationPolicy()) {
	// Assuming all PEs in all Machine have same rating.
		case FogDeviceCharacteristics.TIME_SHARED:
		case FogDeviceCharacteristics.OTHER_POLICY_SAME_RATING:
			mips = getMipsOfOnePe() * HostList.getNumberOfPes(getHostList());
			break;

		// Assuming all PEs in a given Machine have the same rating.
		// But different machines in a Cluster can have different rating
		case FogDeviceCharacteristics.SPACE_SHARED:
		case FogDeviceCharacteristics.OTHER_POLICY_DIFFERENT_RATING:
			for (Host host : getHostList()) {
				mips += host.getTotalMips();
			}
			break;

		default:
			break;
	}

	return mips;
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:41,代码来源:FogDeviceCharacteristics.java


示例3: getMipsOfOnePe

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public long getMipsOfOnePe(int hostId, int peId) {
    if (getHostList().isEmpty()) {
        return -1;
    }

    return PeList.getMips(HostList.getById(getHostList(), hostId).getPeList(), peId);
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:9,代码来源:DatacenterCharacteristicsSimple.java


示例4: getHostWithFreePe

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public Host getHostWithFreePe() {
    return HostList.getHostWithFreePe(getHostList());
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:DatacenterCharacteristicsSimple.java


示例5: getNumberOfPes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public int getNumberOfPes() {
    return HostList.getNumberOfPes(getHostList());
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:DatacenterCharacteristicsSimple.java


示例6: getNumberOfFreePes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public int getNumberOfFreePes() {
    return HostList.getNumberOfFreePes(getHostList());
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:DatacenterCharacteristicsSimple.java


示例7: getNumberOfBusyPes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public int getNumberOfBusyPes() {
    return HostList.getNumberOfBusyPes(getHostList());
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:DatacenterCharacteristicsSimple.java


示例8: setPeStatus

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
@Override
public boolean setPeStatus(Pe.Status status, int hostId, int peId) {
    return HostList.setPeStatus(getHostList(), status, hostId, peId);
}
 
开发者ID:manoelcampos,项目名称:cloudsim-plus,代码行数:5,代码来源:DatacenterCharacteristicsSimple.java


示例9: getMipsOfOnePe

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (Pe). It is
 * essential to use this method when a resource is made up of heterogenous PEs/machines.
 * 
 * @param id the machine ID
 * @param peId the Pe ID
 * @return the MIPS Rating or if no PEs are exists.
 * @pre id >= 0
 * @pre peID >= 0
 * @post $result >= -1
 */
public int getMipsOfOnePe(int id, int peId) {
	if (getHostList().size() == 0) {
		return -1;
	}

	return PeList.getMips(HostList.getById(getHostList(), id).getPeList(), peId);
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:19,代码来源:DatacenterCharacteristics.java


示例10: getHostWithFreePe

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets a Machine with at least one empty Pe.
 * 
 * @return a Machine object or if not found
 * @pre $none
 * @post $none
 */
public Host getHostWithFreePe() {
	return HostList.getHostWithFreePe(getHostList());
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:11,代码来源:DatacenterCharacteristics.java


示例11: getNumberOfPes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets the total number of PEs for all Machines.
 * 
 * @return number of PEs
 * @pre $none
 * @post $result >= 0
 */
public int getNumberOfPes() {
	return HostList.getNumberOfPes(getHostList());
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:11,代码来源:DatacenterCharacteristics.java


示例12: getNumberOfFreePes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets the total number of <tt>FREE</tt> or non-busy PEs for all Machines.
 * 
 * @return number of PEs
 * @pre $none
 * @post $result >= 0
 */
public int getNumberOfFreePes() {
	return HostList.getNumberOfFreePes(getHostList());
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:11,代码来源:DatacenterCharacteristics.java


示例13: getNumberOfBusyPes

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Gets the total number of <tt>BUSY</tt> PEs for all Machines.
 * 
 * @return number of PEs
 * @pre $none
 * @post $result >= 0
 */
public int getNumberOfBusyPes() {
	return HostList.getNumberOfBusyPes(getHostList());
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:11,代码来源:DatacenterCharacteristics.java


示例14: setPeStatus

import org.cloudbus.cloudsim.lists.HostList; //导入依赖的package包/类
/**
 * Sets the particular Pe status on a Machine.
 * 
 * @param status Pe status, either <tt>Pe.FREE</tt> or <tt>Pe.BUSY</tt>
 * @param hostId Machine ID
 * @param peId Pe id
 * @return otherwise (Machine id or Pe id might not be exist)
 * @pre machineID >= 0
 * @pre peID >= 0
 * @post $none
 */
public boolean setPeStatus(int status, int hostId, int peId) {
	return HostList.setPeStatus(getHostList(), status, hostId, peId);
}
 
开发者ID:gmartinezramirez,项目名称:Fog-Computing-Mobile-Architecture,代码行数:15,代码来源:DatacenterCharacteristics.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RegisterNodeManagerRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java RollEditLogRequestProto类代码示例发布时间: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