本文整理汇总了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));
}
示例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));
}
示例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;
}
示例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;
}