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


Java HostList类代码示例

本文整理汇总了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;未经允许,请勿转载。