本文整理汇总了Java中vnreal.network.substrate.SubstrateNetwork.getEndpoints方法的典型用法代码示例。如果您正苦于以下问题:Java SubstrateNetwork.getEndpoints方法的具体用法?Java SubstrateNetwork.getEndpoints怎么用?Java SubstrateNetwork.getEndpoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnreal.network.substrate.SubstrateNetwork
的用法示例。
在下文中一共展示了SubstrateNetwork.getEndpoints方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findBiggestLinkStress
import vnreal.network.substrate.SubstrateNetwork; //导入方法依赖的package包/类
double findBiggestLinkStress(SubstrateNetwork sNetwork,
Collection<SubstrateLink> links) {
double maxNumber = 0.0, tmp = 0.0;
SubstrateLink maxLink = null;
for (SubstrateLink sl : links) {
Pair<SubstrateNode> endpoints = sNetwork.getEndpoints(sl);
if (maxLink == null
| (tmp = getStressLevel(sNetwork, endpoints.getFirst(), sl)) > maxNumber) {
maxNumber = tmp;
maxLink = sl;
}
if (maxLink == null
| (tmp = getStressLevel(sNetwork, endpoints.getSecond(), sl)) > maxNumber) {
maxNumber = tmp;
maxLink = sl;
}
}
return maxNumber;
}
示例2: occupyPathResources
import vnreal.network.substrate.SubstrateNetwork; //导入方法依赖的package包/类
public static LinkedList<ResourceDemandEntry> occupyPathResources(
List<AbstractDemand> demands, List<AbstractDemand> hiddenhopDemands,
List<SubstrateLink> path, SubstrateNetwork sNetwork) {
LinkedList<ResourceDemandEntry> resources =
new LinkedList<ResourceDemandEntry>();
int i = 1;
for (SubstrateLink e : path) {
resources.addAll(occupyResources(demands, e.get()));
if (i != path.size()) {
Pair<SubstrateNode> endpoints = sNetwork.getEndpoints(e);
Collection<ResourceDemandEntry> entry =
occupyHiddenHop(endpoints.getSecond(), hiddenhopDemands);
resources.addAll(entry);
}
++i;
}
return resources;
}