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


Java NetworkEntity.get方法代码示例

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


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

示例1: getMappedVirtualEntities

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
static LinkedList<NetworkEntity<AbstractDemand>> getMappedVirtualEntities(Collection<? extends NetworkEntity<AbstractResource>> entities) {
	LinkedList<NetworkEntity<AbstractDemand>> result = new LinkedList<NetworkEntity<AbstractDemand>>();
	
	for (NetworkEntity<AbstractResource> e : entities) {
		for (AbstractResource res : e.get()) {
			for (Mapping m : res.getMappings()) {
				if (m.getDemand().getOwner() != null) {
					NetworkEntity<AbstractDemand> owner = (NetworkEntity<AbstractDemand>) m.getDemand().getOwner();
					if (!result.contains(owner)) {
						result.add(owner);
					}
				}
			}
		}
	}
	
	return result;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:20,代码来源:MappedRevenue.java

示例2: getStressLevel

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static int getStressLevel(NetworkEntity<? extends AbstractResource> e) {
	List<NetworkEntity<?>> vEntities = new LinkedList<NetworkEntity<?>>();
	
	for (AbstractResource r : e.get()) {
		for (vnreal.mapping.Mapping m : r.getMappings()) {
			AbstractDemand d = m.getDemand();

			if (!(d instanceof HiddenHopEnergyDemand)) {

				NetworkEntity<?> owner = d.getOwner();

				if (!vEntities.contains(owner)) {
					vEntities.add(owner);
				}

			}
		}
	}
	
	return vEntities.size();
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:22,代码来源:Utils.java

示例3: getResource

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static <T extends AbstractResource> T getResource(NetworkEntity<AbstractResource> s, Class<T> type) {
	for (AbstractResource r : s.get()) {
		if (r.getClass().isAssignableFrom(type)) {
			return (T) r;
		}
	}
	return null;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java

示例4: getCpuAvailable

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getCpuAvailable(
		NetworkEntity<? extends AbstractResource> n1) {
	for (AbstractResource res : n1.get()) {
		if (res instanceof CpuResource) {
			return ((CpuResource) res).getAvailableCycles();
		}
	}
	return 0.0;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java

示例5: getBandwidthAvailable

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getBandwidthAvailable(
		NetworkEntity<? extends AbstractResource> n1) {
	for (AbstractResource res : n1.get()) {
		if (res instanceof BandwidthResource) {
			return ((BandwidthResource) res).getAvailableBandwidth();
		}
	}
	return 0.0;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java

示例6: getBandwidthDemand

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getBandwidthDemand(NetworkEntity<? extends AbstractDemand> n) {
	for (AbstractDemand dem : n.get()) {
		if (dem instanceof BandwidthDemand) {
			return ((BandwidthDemand) dem).getDemandedBandwidth();
		}
	}
	return 0.0;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:9,代码来源:Utils.java

示例7: getCpuRemaining

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static double getCpuRemaining(
		NetworkEntity<? extends AbstractResource> n1,
		NetworkEntity<? extends AbstractDemand> n2) {
	for (AbstractResource res : n1.get()) {
		if (res instanceof CpuResource) {
			for (AbstractDemand dem : n2.get()) {
				if (dem instanceof CpuDemand) {
					return ((CpuResource) res).getAvailableCycles()
							- (((CpuDemand) dem)).getDemandedCycles();
				}
			}
		}
	}
	return 0.0;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:16,代码来源:Utils.java

示例8: getCpuResource

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static CpuResource getCpuResource(
		NetworkEntity<? extends AbstractResource> n) {
	for (AbstractResource res : n.get()) {
		if (res instanceof CpuResource) {
			return (CpuResource) res;
		}
	}
	return null;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java

示例9: getCpuDemand

import vnreal.network.NetworkEntity; //导入方法依赖的package包/类
public static CpuDemand getCpuDemand(NetworkEntity<? extends AbstractDemand> n) {
	for (AbstractDemand dem : n.get()) {
		if (dem instanceof CpuDemand) {
			return (CpuDemand) dem;
		}
	}
	return null;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:9,代码来源:Utils.java


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