/** Returns true if the multicast tree is reaching all the egress nodes of the demand * @return see above */ public boolean isReachinAllDemandEgressNodes () { return getEgressNodesReached().equals(getMulticastDemand().getEgressNodes()); }
private TBFToFromCarriedTraffic(MulticastTree tree, boolean onlyThisLayer) { super(tree.getNetPlan()); this.initialElement = tree; this.onlyThisLayer = onlyThisLayer; this.initialFR = null; this.auxLayerInNodes = null; final Set<Link> linksAllLayers = new HashSet<>(); final Set<Demand> demandsAllLayers = new HashSet<>(); final Set<MulticastDemand> mDemandsAllLayers = new HashSet<>(); mDemandsAllLayers.add(tree.getMulticastDemand()); linksAllLayers.addAll(tree.getLinkSet()); if (!onlyThisLayer) updatePropagationDownWards(linksAllLayers, linksAllLayers, demandsAllLayers, mDemandsAllLayers); if (!onlyThisLayer) updatePropagationUpWards(demandsAllLayers, mDemandsAllLayers, linksAllLayers, demandsAllLayers, mDemandsAllLayers); final Set<NetworkLayer> layersToKeepAllElements = onlyThisLayer ? Sets.difference(new HashSet<>(netPlan.getNetworkLayers()), Sets.newHashSet(tree.getLayer())) : new HashSet<>(); updateAllButLinksDemandsMDemandsUsingExistingInfo(linksAllLayers, demandsAllLayers, mDemandsAllLayers, layersToKeepAllElements); }
void updateLinkTrafficAndOccupation () { /* Add the info of the demands with traversing routes */ this.cache_totalCarriedTraffic = 0; this.cache_totalOccupiedCapacity = 0; for (Entry<Route,Integer> travRouteInfo : cache_traversingRoutes.entrySet()) { final Route r = travRouteInfo.getKey(); final double carriedTraffic = r.getCarriedTraffic(); final double occupiedCapacity = r.getOccupiedCapacity(this); this.cache_totalCarriedTraffic += carriedTraffic; this.cache_totalOccupiedCapacity += occupiedCapacity; } /* Add the info of the demands with forwarding rules */ for (Entry<Demand,Pair<Double,Double>> entryInfo : this.cacheHbH_normCarriedOccupiedPerTraversingDemandCurrentState.entrySet()) { final Demand demand = entryInfo.getKey(); final double occupiedCapacityAndCarriedTraffic = entryInfo.getValue().getSecond(); this.cache_totalCarriedTraffic += occupiedCapacityAndCarriedTraffic; this.cache_totalOccupiedCapacity += occupiedCapacityAndCarriedTraffic; } for (MulticastTree t : cache_traversingTrees) { final MulticastDemand demand = t.getMulticastDemand(); final double occupiedCapacity = t.getOccupiedLinkCapacity(); final double carriedTraffic = t.getCarriedTraffic(); this.cache_totalCarriedTraffic += carriedTraffic; this.cache_totalOccupiedCapacity += occupiedCapacity; } }
@Override public List<AjtColumnInfo<MulticastTree>> getNonBasicUserDefinedColumnsVisibleOrNot() { final List<AjtColumnInfo<MulticastTree>> res = new LinkedList<> (); res.add(new AjtColumnInfo<MulticastTree>(this , Node.class, null , "A", "Ingress node", null , d->d.getIngressNode() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , String.class, null , "Bs", "Egress nodes", null , d->d.getMulticastDemand().getEgressNodes().stream().map(n->n.getName().equals("")? "Node " + n.getIndex() : n.getName()).collect(Collectors.joining(",")) , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , String.class, null , "Bs (reached)", "Reached egress nodes", null , d->d.getEgressNodesReached().stream().map(n->n.getName().equals("")? "Node " + n.getIndex() : n.getName()).collect(Collectors.joining(",")) , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Integer.class, null , "# Bs not reached", "Number of non-reached egress nodes", null , d->d.getMulticastDemand().getEgressNodes().size() - d.getEgressNodesReached().size() , AGTYPE.SUMINT , d-> d.getMulticastDemand().getEgressNodes().size() - d.getEgressNodesReached().size() > 0? Color.RED : null)); res.add(new AjtColumnInfo<MulticastTree>(this , MulticastDemand.class, null , "Demand", "Associated multicast demand", null , d->d.getMulticastDemand() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Carried traffic (" + getTableNetworkLayer().getDemandTrafficUnits() + ")", "Carried traffic by the multicast tree", null , d->d.getCarriedTraffic() , AGTYPE.SUMDOUBLE , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Occupied capacity (" + getTableNetworkLayer().getLinkCapacityUnits() + ")", "Occupied capacity in the traversed links", null, d->d.getOccupiedLinkCapacity() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Collection.class, null , "Traversed links", "Traversed links in the non-failure state", null, d->d.getLinkSet() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Total tree length (km)", "Sum of the lengths of all the tree links (accumulating any lower layer propagation lengths if any)", null, d->d.getTreeTotalLengthInKm() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Worst e2e lat (ms)", "Current worst case end-to-end propagation time in miliseconds (accumulating any lower layer propagation times if any), from the origin node, to destination nodes reached", null, d->d.getTreeMaximumPropagationDelayInMs() , AGTYPE.NOAGGREGATION , d->{ final double m = d.getMulticastDemand().getMaximumAcceptableE2EWorstCaseLatencyInMs(); if (m >= 0) return null; return d.getTreeMaximumPropagationDelayInMs () > m? Color.RED : null; })); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Worst e2e length (km)", "Current worst case end-to-end propagation length in km (accumulating any lower layer propagation lengths if any)", null, d->d.getTreeMaximumPathLengthInKm() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastTree>(this , Double.class, null , "Worst e2e length (hops)", "Current worst case end-to-end propagation length in number of traversed links", null, d->d.getTreeMaximumPathLengthInHops() , AGTYPE.NOAGGREGATION , null)); return res; }
if (!pathToEgressNode.contains(this)) continue; if (!netPlan.isUp (pathToEgressNode)) continue; SortedSet<Link> linksSoFar = resMCast.get(Pair.of(t.getMulticastDemand() , egressNode)); if (linksSoFar == null) { linksSoFar = new TreeSet<> (); resMCast.put(Pair.of(t.getMulticastDemand() , egressNode), linksSoFar); } linksSoFar.addAll(pathToEgressNode);
private List<Triple<String,String,String>> getMulticastTreeInfoTables (MulticastTree t) { final DecimalFormat df = new DecimalFormat("###.##"); final NetPlan np = t.getNetPlan(); final List<Triple<String,String,String>> res = new ArrayList <> (); res.add(Triple.of("Tree index/id" , "Tree " + t.getIndex() + " (id " + t.getId() + ")", "multicastTre" + t.getId())); res.add(Triple.of("Layer" , "" + getLayerName(t.getLayer()) , "layer" + t.getLayer().getId())); res.add(Triple.of("Tree demand" , "Multicast demand " + t.getMulticastDemand().getIndex() + " (id " + t.getMulticastDemand().getId() + ")" , "multicastDemand" + t.getMulticastDemand().getId())); res.add(Triple.of("M. Demand offered traffic" , "" + df.format(t.getMulticastDemand().getOfferedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()) , "")); res.add(Triple.of("M. Demand carried traffic" , "" + df.format(t.getMulticastDemand().getCarriedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()) , "")); res.add(Triple.of("Tree carried traffic" , "" + df.format(t.getCarriedTraffic()) + " " + np.getDemandTrafficUnitsName(t.getLayer()), "")); res.add(Triple.of("Is up?" , "" + !t.isDown(), "")); res.add(Triple.of("Worst link utilization" , "" + df.format(t.getLinkSet().stream().mapToDouble(e->e.getUtilization()).max().orElse(0)), "")); res.add(Triple.of("E2E num. hops (av / max)" , "" + df.format(t.getTreeAveragePathLengthInHops()) + " / " + df.format(t.getTreeMaximumPathLengthInHops()) , "")); res.add(Triple.of("E2E length in km (av / max)" , "" + df.format(t.getTreeAveragePathLengthInHops()) + " / " + df.format(t.getTreeMaximumPathLengthInKm()) + " km", "")); res.add(Triple.of("E2E length in ms (av / max)" , "" + df.format(t.getTreeAveragePropagationDelayInMs()) + " / " + df.format(t.getTreeMaximumPropagationDelayInMs()) + " ms", "")); return res; } private List<Triple<String,String,String>> getDemandInfoTables (Demand d)
final String qos = tree.getMulticastDemand().getQosType(); if (check_occupAndViolationPerQos.containsKey(qos)) check_occupAndViolationPerQos.put(qos , check_occupAndViolationPerQos.get(qos) + tree.getOccupiedLinkCapacity());
if (mDemands.contains(t.getMulticastDemand())) trees.add(t);
final MulticastDemand demand = t.getMulticastDemand(); final String qosType = demand.getQosType(); final double occupiedCapacity = t.getOccupiedLinkCapacity();
DrawUtils.drawDownPropagationInterLayerLinks(vs, ipg.getLinksInGraph(), VisualizationConstants.DEFAULT_REGGUILINK_EDGECOLOR_PICKED); if (vs.isShowInCanvasUpperLayerPropagation() && (vs.getNetPlan().getNumberOfLayers() > 1) && pickedTree.getMulticastDemand().isCoupled()) final SortedSet<Link> upperCoupledLink = DrawUtils.getUpCoupling(null, Arrays.asList(Pair.of(pickedTree.getMulticastDemand(), egressNode))); final InterLayerPropagationGraph ipg = new InterLayerPropagationGraph(null, upperCoupledLink, null, true); DrawUtils.drawCollateralLinks(vs, ipg.getLinksInGraph(), VisualizationConstants.DEFAULT_REGGUILINK_EDGECOLOR_PICKED);