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


Java SubstrateLink.get方法代码示例

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


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

示例1: calculate

import vnreal.network.substrate.SubstrateLink; //导入方法依赖的package包/类
@Override
public double calculate(NetworkStack stack) {
	double linkCost = 0;
	BandwidthDemand tmpBwDem;
	for (Iterator<SubstrateLink> tmpSLink = stack.getSubstrate().getEdges()
			.iterator(); tmpSLink.hasNext();) {
		SubstrateLink currSLink = tmpSLink.next();
		AbstractResource res = currSLink.get(BandwidthResource.class);
		if (res != null) {
			for (Mapping f : res.getMappings()) {
				tmpBwDem = (BandwidthDemand) f.getDemand();
				linkCost += tmpBwDem.getDemandedBandwidth();
			}
		}
	}
	RejectedNetworksNumber numRej = new RejectedNetworksNumber();

	return linkCost / ((stack.size() - 1) - numRej.calculate(stack));

}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:21,代码来源:LinkCostPerVnr.java

示例2: calculate

import vnreal.network.substrate.SubstrateLink; //导入方法依赖的package包/类
public double calculate(NetworkStack stack) {
	double sum = 0.0;
	int i = 0;
	SubstrateNetwork sNetwork = stack.getSubstrate();

	for (SubstrateLink sl : sNetwork.getEdges()) {
		for (AbstractResource res : sl.get()) {
			for (Mapping m : res.getMappings()) {
				AbstractDemand dem = m.getDemand();

				if (dem instanceof BandwidthDemand) {
					sum += ((BandwidthDemand) dem).getDemandedBandwidth();
					i++;
				}
			}
		}
	}

	return (i == 0 ? 0.0 : (sum / (double) i));
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:21,代码来源:LinkUtilization.java

示例3: calculate

import vnreal.network.substrate.SubstrateLink; //导入方法依赖的package包/类
@Override
public double calculate(NetworkStack stack) {
	double totalBW = 0;
	for (SubstrateLink link : stack.getSubstrate().getEdges()) {
		AbstractResource res = link.get(BandwidthResource.class);
		if (res != null) {
			totalBW += ((BandwidthResource) res).getBandwidth();
		}
	}
	return totalBW;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:12,代码来源:TotalBWRes.java

示例4: getBandwidthResource

import vnreal.network.substrate.SubstrateLink; //导入方法依赖的package包/类
public static BandwidthResource getBandwidthResource(SubstrateLink sl) {
	for (AbstractResource r : sl.get()) {
		if (r instanceof BandwidthResource) {
			return (BandwidthResource) r;
		}
	}

	return null;
}
 
开发者ID:KeepTheBeats,项目名称:alevin-svn2,代码行数:10,代码来源:Utils.java


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