本文整理汇总了Java中net.floodlightcontroller.routing.BroadcastTree.getTreeLink方法的典型用法代码示例。如果您正苦于以下问题:Java BroadcastTree.getTreeLink方法的具体用法?Java BroadcastTree.getTreeLink怎么用?Java BroadcastTree.getTreeLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.routing.BroadcastTree
的用法示例。
在下文中一共展示了BroadcastTree.getTreeLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPath
import net.floodlightcontroller.routing.BroadcastTree; //导入方法依赖的package包/类
protected static MetricEdge getPath(Long src, Long dst){
BroadcastTree tree = destinationRootedTrees.get(dst);
if(src.equals(dst)){
return null;
}
ArrayList<Link> path = new ArrayList<Link>();
int cost = tree.getCost(src);
Long tmpsrc = src;
do{
Link link = tree.getTreeLink(tmpsrc);
if(link == null) break;
// cost += tree.getCost(src);
tmpsrc = link.getDst();
path.add(link);
}while(true);
MetricEdge metricEdge = new MetricEdge(src, dst, path, cost );
return metricEdge;
}
示例2: getDist
import net.floodlightcontroller.routing.BroadcastTree; //导入方法依赖的package包/类
private Integer getDist(Long switchid, Long rootid, HashMap<Long, Integer> metric, BroadcastTree tree){
if(switchid == null || switchid.equals(rootid)){
return 0;
}
if(metric.containsKey(switchid) == true){
return metric.get(switchid);
}else{
Link link = tree.getTreeLink(switchid);
Long neighbour = link.getDst();
int cost = tree.getCost(switchid);
return cost + getDist(neighbour, rootid, metric, tree);
}
}
示例3: getPath
import net.floodlightcontroller.routing.BroadcastTree; //导入方法依赖的package包/类
private ArrayList<Link> getPath(Long src, Long dst, Map<Long, BroadcastTree> drtree) {
// TODO Auto-generated method stub
ArrayList<Link> retpath = new ArrayList<Link>();
BroadcastTree btree = drtree.get(dst);
Link link = btree.getTreeLink(src) ;
while( link != null){
retpath.add(link);
src = link.getDst();
link = btree.getTreeLink(src) ;
}
return retpath;
}