@Override public List<AjtColumnInfo<MulticastDemand>> getNonBasicUserDefinedColumnsVisibleOrNot() { final List<AjtColumnInfo<MulticastDemand>> res = new LinkedList<> (); res.add(new AjtColumnInfo<MulticastDemand>(this , Node.class, null , "A", "Ingress node", null , d->d.getIngressNode() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "Bs", "Egress nodes", null , d->d.getEgressNodes().stream().map(n->n.getName().equals("")? "Node " + n.getIndex() : n.getName()).collect(Collectors.joining(",")) , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Collection.class, null , "Coupled links", "The links that this demand is coupled to, if any", null , d->d.isCoupled()? d.getCoupledLinks() : "-" , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Offered traffic (" + getTableNetworkLayer().getLinkCapacityUnits() + ")", "Offered traffic by the demand", (d,val)->d.setOfferedTraffic((Double) val), d->d.getOfferedTraffic() , AGTYPE.SUMDOUBLE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Carried traffic (" + getTableNetworkLayer().getLinkCapacityUnits() + ")", "Carried traffic by the demand", null , d->d.getCarriedTraffic() , AGTYPE.SUMDOUBLE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "% Lost traffic", "Percentage of the lost traffic by the demand", null, d->d.getOfferedTraffic() == 0? 0 : d.getBlockedTraffic() / d.getOfferedTraffic() , AGTYPE.NOAGGREGATION , d->d.getBlockedTraffic() > 0? Color.RED : Color.GREEN)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "QoS type", "A used-defined string identifying the type of traffic of the demand", (d,val)-> d.setQoSType((String)val) , d->d.getQosType(), AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Boolean.class, null , "All nodes reached?", "True if all the multicast trees of the demand reach all the demand egress nodes", null, d->d.isAllTreesReachingAllEgressNodes() , AGTYPE.COUNTTRUE , d->d.isAllTreesReachingAllEgressNodes()? Color.GREEN : Color.RED)); res.add(new AjtColumnInfo<MulticastDemand>(this , String.class, null , "Bifurcated?", "Indicates whether the demand is satisfied by more than one multicast tree", null, d->d.isBifurcated() , AGTYPE.COUNTTRUE , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Integer.class, null , "# trees", "Number of associated multicast trees", null, d->d.getMulticastTrees().size() , AGTYPE.SUMINT , null)); res.add(new AjtColumnInfo<MulticastDemand>(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.getWorseCasePropagationTimeInMs() , AGTYPE.NOAGGREGATION , d->{ final double maxMs = d.getMaximumAcceptableE2EWorstCaseLatencyInMs(); return maxMs <= 0? null : (d.getWorseCasePropagationTimeInMs() > maxMs? Color.RED : null); })); res.add(new AjtColumnInfo<MulticastDemand>(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.getWorstCaseLengthInKm() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "Limit e2e lat (ms)", "Maximum end-to-end propagation time in miliseconds (accumulating any lower layer propagation times if any)", (d,val)-> d.setMaximumAcceptableE2EWorstCaseLatencyInMs((Double)val) , d->d.getMaximumAcceptableE2EWorstCaseLatencyInMs() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Double.class, null , "CAGR(%)" , "Compound annual growth factor for this demand", (d,val)->d.setOfferedTrafficPerPeriodGrowthFactor((Double) val), d->d.getOfferedTrafficPerPeriodGrowthFactor() , AGTYPE.NOAGGREGATION , null)); res.add(new AjtColumnInfo<MulticastDemand>(this , Integer.class, null , "#Monit points" , "Number of samples of the offered traffic stored, coming from a monitoring or forecasting traffic process", null , d->d.getMonitoredOrForecastedOfferedTraffic().getSize() , AGTYPE.NOAGGREGATION , null)); return res; }
private List<Triple<String,String,String>> getMulticastDemandInfoTables (MulticastDemand md) { final DecimalFormat df = new DecimalFormat("###.##"); final NetPlan np = md.getNetPlan(); final NetworkLayer layer = md.getLayer(); final List<Triple<String,String,String>> res = new ArrayList <> (); res.add(Triple.of("Demand index/id" , "M. demand " + md.getIndex() + " (id " + md.getId() + ")", "multicastDemand" + md.getId())); res.add(Triple.of("Layer" , "" + getLayerName(layer) , "layer" + layer.getId())); res.add(Triple.of("Offered traffic" , "" + df.format(md.getOfferedTraffic()) , "")); res.add(Triple.of("Carried traffic" , "" + df.format(md.getCarriedTraffic()) , "")); res.add(Triple.of("Lost traffic" , "" + df.format(md.getBlockedTraffic()) , "")); if (md.isCoupled()) { final Set<Link> coupledLinks = md.getCoupledLinks(); final NetworkLayer upperLayer = coupledLinks.iterator().next().getLayer(); res.add(Triple.of("- Upper layer coupled to", getLayerName(upperLayer) , "layer" + upperLayer.getId())); for (Link c : coupledLinks) res.add(Triple.of("- Coupled to", "Link " + c.getIndex() + " (id " + c.getId() + ")" , "link" + c.getId())); } res.add(Triple.of("Num. trees" , "" + md.getMulticastTrees().size() , "")); // for (MulticastTree t : md.getMulticastTrees()) // res.add(Triple.of("Multicast tree index/id" , "Multicast tree " + t.getIndex() + " (id " + t.getId() + ")" , "multicastTree" + t.getId())); res.add(Triple.of("Worst case e2e latency" , df.format(md.getWorseCasePropagationTimeInMs()) + " ms", "")); return res; }
/** * <p>Removes this multicast demand, and any associated multicast trees. If the demand is coupled, it is first decoupled. </p> */ public void remove() { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.coupledUpperLayerLinks != null) this.decouple (); for (MulticastTree tree : new TreeSet<MulticastTree> (cache_multicastTrees)) tree.remove(); netPlan.cache_id2MulticastDemandMap.remove(id); NetPlan.removeNetworkElementAndShiftIndexes (layer.multicastDemands , index); ingressNode.cache_nodeOutgoingMulticastDemands.remove (this); for (Node egressNode : egressNodes) egressNode.cache_nodeIncomingMulticastDemands.remove (this); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); final Pair<SortedSet<Demand>,SortedSet<MulticastDemand>> qosInfo = layer.cache_qosTypes2DemandMap.get(qosType); assert qosInfo != null; final boolean removed = qosInfo.getSecond().remove(this); assert removed; if (qosInfo.getFirst().isEmpty() && qosInfo.getSecond().isEmpty()) layer.cache_qosTypes2DemandMap.remove(qosType); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); }
private TBFToFromCarriedTraffic(MulticastDemand demand, boolean onlyThisLayer) { super(demand.getNetPlan()); this.initialElement = demand; 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(demand); final Set<Link> thisLayerPropagation = new HashSet<>(); for (Node egressNode : demand.getEgressNodes()) thisLayerPropagation.addAll(demand.getLinksNoDownPropagationPotentiallyCarryingTraffic(egressNode)); linksAllLayers.addAll(thisLayerPropagation); 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(demand.getLayer())) : new HashSet<>(); updateAllButLinksDemandsMDemandsUsingExistingInfo(linksAllLayers, demandsAllLayers, mDemandsAllLayers, layersToKeepAllElements); }
e.remove(); for (MulticastDemand e : new ArrayList<> (this.getMulticastDemands(thisLayer))) if (nodesThis_thisAndOther.contains(e.getIngressNode()) && nodesThis_thisAndOther.containsAll(e.getEgressNodes())) e.remove(); if (this.getMulticastDemandFromId(otherDemand.getId()) != null) throw new RuntimeException(); final Node this_ae = (Node)thatToThisTranslation.get(otherDemand.getIngressNode()); final SortedSet<Node> this_be = otherDemand.getEgressNodes().stream().map(x->(Node)thatToThisTranslation.get(x)).collect(Collectors.toCollection(TreeSet::new)); final MulticastDemand thisDemand = this.addMulticastDemand(this_ae, this_be, 0, null, thisLayer); thisDemand.setOfferedTraffic(otherDemand.getOfferedTraffic()); thisDemand.setAttributeMap(otherDemand.getAttributes()); // previous attributes are not removed, just new added or existing updated for (String tag : otherDemand.getTags()) thisDemand.addTag(tag); thatToThisTranslation.put(otherDemand , thisDemand); for (MulticastTree other : otherDemand.getMulticastTrees()) if (!otherDemand.isCoupled()) continue; final MulticastDemand thisDemand = (MulticastDemand) thatToThisTranslation.get(otherDemand); final SortedSet<Link> otherUpperLinks = otherDemand.getCoupledLinks(); final SortedSet<Link> thisUpperLinks = otherUpperLinks.stream().map(x->(Link) thatToThisTranslation.get(x)).collect(Collectors.toCollection(TreeSet::new)); thisDemand.couple(thisUpperLinks);
for (MulticastDemand demand : demands.getMulticastDemands()) netPlan.addMulticastDemand(demand.getIngressNode(), demand.getEgressNodes(), demand.getOfferedTraffic(), demand.getAttributes(), layer);
final List<AjtRcMenu> res = new ArrayList<> (); res.add(new AjtRcMenu("Add demand", e->createMulticastDemandGUI(getTableNetworkLayer () , callback), (a,b)->true, null)); res.add(new AjtRcMenu("Remove selected demands", e->getSelectedElements().forEach(dd->((MulticastDemand)dd).remove()) , (a,b)->b>0, null)); res.add(new AjtRcMenu("Add one broadcast demand per node", e->new BroadcastDemandPerNode().execute() , (a,b)->true, null)); res.add(new AjtRcMenu("Add one demand per ingress node, with random egress nodes", e->new MulticastDemandPerNode().execute() , (a,b)->true, null)); getSelectedElements().forEach(dd->dd.setQoSType(qos)); getSelectedElements().forEach(dd->((MulticastDemand)dd).setMaximumAcceptableE2EWorstCaseLatencyInMs(newLimit)); callback.getWhatIfAnalysisPane().whatIfMulticastDemandOfferedTrafficModified(changedDemands, Collections.nCopies(changedDemands.size(), newOfferedTraffic)); else changedDemands.forEach(d->d.setOfferedTraffic(newOfferedTraffic)); callback.getWhatIfAnalysisPane().whatIfMulticastDemandOfferedTrafficModified(changedDemands, changedDemands.stream().map(d-> new Double ((d.getOfferedTraffic () * neScalingFactor))).collect(Collectors.toList())); else changedDemands.forEach(d->d.setOfferedTraffic(d.getOfferedTraffic() * neScalingFactor)); } catch (Throwable ex) { ex.printStackTrace(); throw new Net2PlanException (ex.getMessage()); } res.add(new AjtRcMenu("Decouple selected demands", e->getSelectedElements().forEach(dd->((MulticastDemand)dd).decouple()) , (a,b)->b>0, null)); NetworkLayer layer = np.getNetworkLayerFromId(layerId); for (MulticastDemand demand : getSelectedElements()) if (!demand.isCoupled()) demand.coupleToNewLinksCreated(layer); MonitoringUtils.getMenuForecastDemandTrafficUsingGravityModel (this), MonitoringUtils.getMenuForecastDemandTrafficFromLinkInfo (this), new AjtRcMenu("Remove all monitored/forecast stored information", e->getSelectedElements().forEach(dd->((MulticastDemand)dd).getMonitoredOrForecastedOfferedTraffic().removeAllValues()) , (a,b)->b>0, null),
final boolean isDemandLayerVisibleInTheCanvas = vs.isLayerVisibleInCanvas(pickedDemand.getLayer()); final GUINode gnOrigin = vs.getCanvasAssociatedGUINode(pickedDemand.getIngressNode(), pickedDemand.getLayer()); SortedSet<Link> linksThisLayer = null; for (Node egressNode : pickedDemand.getEgressNodes()) final GUINode gnDestination = vs.getCanvasAssociatedGUINode(egressNode, pickedDemand.getLayer()); if (vs.isShowInCanvasThisLayerPropagation() && isDemandLayerVisibleInTheCanvas) linksThisLayer = pickedDemand.getLinksNoDownPropagationPotentiallyCarryingTraffic(egressNode); DrawUtils.drawCollateralLinks(vs, linksThisLayer, VisualizationConstants.DEFAULT_REGGUILINK_EDGECOLOR_PICKED); linksThisLayer = pickedDemand.getLinksNoDownPropagationPotentiallyCarryingTraffic(egressNode); final Pair<SortedSet<Demand>, SortedSet<Pair<MulticastDemand, Node>>> downLayerInfo = DrawUtils.getDownCoupling(linksThisLayer); final InterLayerPropagationGraph ipg = new InterLayerPropagationGraph(downLayerInfo.getFirst(), null, downLayerInfo.getSecond(), false); DrawUtils.drawDownPropagationInterLayerLinks(vs, linksLowerLayers, VisualizationConstants.DEFAULT_REGGUILINK_EDGECOLOR_PICKED); if (vs.isShowInCanvasUpperLayerPropagation() && (vs.getNetPlan().getNumberOfLayers() > 1) && pickedDemand.isCoupled())
for (Node t : d.getEgressNodes()) A_ndt.set (new int [] { d.getIngressNode().getIndex() , d.getIndex () , t.getIndex () } , 1.0); A_ndt.set (new int [] { t.getIndex () , d.getIndex () , t.getIndex () } , -1.0); for (Link e : netPlan.getLinks()) for (Node n : netPlan.getNodes()) if (xx_de.get(d.getIndex () , e.getIndex ()) == 0) if (xx_det.get(new int [] {d.getIndex() , e.getIndex () , n.getIndex() } ) != 0) throw new RuntimeException ("Bad: x_de: " + (xx_de.get(d.getIndex () , e.getIndex ())) + ", xx_det: " + (xx_det.get(new int [] {d.getIndex() , e.getIndex () , n.getIndex() } )) ); Set<Link> linkSet = new HashSet<Link> (); for (int e = 0 ; e < E ; e ++) if (xx_de.get(d.getIndex() , e) != 0) { linkSet.add (netPlan.getLink (e)); } netPlan.addMulticastTree(d , d.getOfferedTraffic() , d.getOfferedTraffic() , linkSet , null);
for (MulticastDemand d : np.getMulticastDemands (layer)) String egressNodesInfo = ""; for (Node n : d.getEgressNodes()) egressNodesInfo += n.getIndex () + "(" + n.getName () + ") "; out.append("<tr><td> " + d.getIndex () + " id (" + d.getId () + ")" + "</td><td>" + d.getIngressNode ().getIndex () + " (" + d.getIngressNode ().getName () + ") </td><td> " + egressNodesInfo + "</td><td>" + avTotal_md.get(d.getIndex()) + " ... " + (avTotal_md.get(d.getIndex()) + pi_excess) + "</td><td>" + survTotal_md.get(d.getIndex()) + " ... " + (survTotal_md.get(d.getIndex()) + pi_excess) + "</td></tr>");
if (inputMonitInfo_someMDemands == null) inputMonitInfo_someMDemands = new HashMap<> (); else inputMonitInfo_someMDemands = inputMonitInfo_someMDemands.entrySet().stream ().filter(e->e.getKey().getLayer().equals(layer)).collect (Collectors.toMap(e->e.getKey (), e->e.getValue())); if (inputMonitInfo_someLinks == null) inputMonitInfo_someLinks = new HashMap<> (); else inputMonitInfo_someLinks = inputMonitInfo_someLinks.entrySet().stream ().filter(e->e.getKey().getLayer().equals(layer)).collect (Collectors.toMap(e->e.getKey (), e->e.getValue())); x_de.set(d.getIndex(), fr.getKey().getIndex(), fr.getValue()); for (MulticastDemand d : mdemands) for (Entry<Link,Double> fr : d.getTraversedLinksAndCarriedTraffic(true).entrySet()) x_mde.set(d.getIndex(), fr.getKey().getIndex(), fr.getValue()); if (D>0) op.setInputParameter("x_de", x_de); if (MD>0) op.setInputParameter("x_mde", x_mde); mdemandIndexesWithEstim_estmd.add(d.getIndex()); demandTrafficsEstim_md [d.getIndex()] = traf; np.getMulticastDemand(dIndex, layer).setOfferedTraffic(h_md [dIndex]); final double averageDeviation_md = inputMonitInfo_someMDemands.entrySet().stream().mapToDouble(e-> { MulticastDemand d = e.getKey(); double est = e.getValue(); double val = d.getOfferedTraffic(); return Math.pow (est - val , 2); }).sum (); final double averageDeviation_e = inputMonitInfo_someLinks.entrySet().stream().mapToDouble(e-> { Link d = e.getKey(); double est = e.getValue(); double val = d.getCarriedTraffic(); return Math.pow (est - val , 2); }).sum ();
final NetworkLayer downLayer = lowerLayerDemand.getLayer(); if (regularLinkIsPrimary) resPrimary.addAll(getCanvasIntraNodeGUILinkSequence(lowerLayerDemand.getIngressNode(), upperLayer, downLayer)); resPrimary.addAll(getCanvasIntraNodeGUILinkSequence(lowerLayerDemand.getIngressNode(), downLayer, upperLayer)); for (Node n : lowerLayerDemand.getEgressNodes()) resBackup.addAll(getCanvasIntraNodeGUILinkSequence(lowerLayerDemand.getIngressNode(), upperLayer, downLayer)); resBackup.addAll(getCanvasIntraNodeGUILinkSequence(lowerLayerDemand.getIngressNode(), downLayer, upperLayer)); for (Node n : lowerLayerDemand.getEgressNodes()) for (MulticastTree t : lowerLayerDemand.getMulticastTrees()) for (Link ee : t.getLinkSet())
for (MulticastDemand demand : netPlan.getMulticastDemands()) Set<Link> linkSet = GraphUtils.getMinimumCostMulticastTree(getTableNetworkLayer(), Aout_ne, Ain_ne, linkCosts, demand.getIngressNode(), demand.getEgressNodes(), E, -1, -1.0, -1.0, solverName, solverLibraryName, 5.0); addedTrees.add(netPlan.addMulticastTree(demand, demand.getOfferedTraffic(), demand.getOfferedTraffic(), linkSet, null)); for (Node egressNode : demand.getEgressNodes()) List<Link> seqLinks = GraphUtils.getShortestPath(netPlan.getNodes(), netPlan.getLinks(), demand.getIngressNode(), egressNode, linkCostMap); if (seqLinks.isEmpty()) throw new Net2PlanException("The multicast tree cannot be created since the network is not connected"); linkSet.addAll(seqLinks); addedTrees.add(netPlan.addMulticastTree(demand, demand.getOfferedTraffic(), demand.getOfferedTraffic(), linkSet, null));
DrawLine(DrawNode from, DrawNode to, Link e, Point pFrom, Point pTo, double occupiedToShow) { final String capUnits = e.getNetPlan().getLinkCapacityUnitsName(e.getLayer()); this.from = from; this.to = to; this.pFrom = pFrom; this.pTo = pTo; this.labels = new ArrayList<>(); this.urlsLabels = new ArrayList<>(); final DecimalFormat df = new DecimalFormat("###.##"); String length_km = df.format((e.getLengthInKm() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getLengthInKm()); String delay_ms = df.format((e.getPropagationDelayInMs() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getPropagationDelayInMs()); this.labels.addAll(Arrays.asList( "Link " + e.getIndex() , length_km + " km (" + delay_ms + " ms)" , "Occup: " + String.format("%.1f" , occupiedToShow) + " " + capUnits, "Total: " + String.format("%.1f" , e.getOccupiedCapacity()) + "/" + String.format("%.1f" , e.getCapacity()) + " " + capUnits )); this.urlsLabels.addAll(Arrays.asList("link" + e.getId(), "", "", "")); if (e.getCoupledDemand() != null) { labels.add("Coupled: Demand " + e.getCoupledDemand().getIndex() + ", " + getLayerName(e.getCoupledDemand().getLayer())); urlsLabels.add("demand" + e.getCoupledDemand().getId()); } else if (e.getCoupledMulticastDemand() != null) { labels.add("Coupled: Multicast demand " + e.getCoupledMulticastDemand().getIndex() + ", " + getLayerName(e.getCoupledMulticastDemand().getLayer())); urlsLabels.add("multicastDemand" + e.getCoupledMulticastDemand().getId()); } this.associatedElement = e; }
if (considerTrafficInOversubscribedLinksAsLost.getBoolean()) for (MulticastDemand d : netPlan.getMulticastDemands (layer)) if (d.isTraversingOversubscribedLinks()) blocked_md.set (d.getIndex () , d.getOfferedTraffic()); if (maximumE2ELatencyMs.getDouble () > 0) for (MulticastDemand d : netPlan.getMulticastDemands(layer)) if (d.getWorseCasePropagationTimeInMs() > maximumE2ELatencyMs.getDouble ()) blocked_md.set (d.getIndex () , d.getOfferedTraffic()); final DoubleMatrix1D h_md = auxNetPlan.getVectorMulticastDemandOfferedTraffic(layer); final DoubleMatrix1D blocked_md = auxNetPlan.getVectorMulticastDemandBlockedTraffic(layer); if (considerTrafficInOversubscribedLinksAsLost.getBoolean()) for (MulticastDemand d : auxNetPlan.getMulticastDemands (layer)) if (d.isTraversingOversubscribedLinks()) blocked_md.set (d.getIndex () , d.getOfferedTraffic()); if (maximumE2ELatencyMs.getDouble () > 0) for (MulticastDemand d : auxNetPlan.getMulticastDemands(layer)) if (d.getWorseCasePropagationTimeInMs() > maximumE2ELatencyMs.getDouble ()) blocked_md.set (d.getIndex () , d.getOfferedTraffic());
final int regularInterlineSpacePixels = fontMetrics.getHeight(); final DrawNode ingressNode = new DrawNode(multicastDemand.getIngressNode(), multicastDemand.getLayer(), maxIconSize); for (Node node : multicastDemand.getEgressNodes()) final DrawNode egressNode = new DrawNode(node, multicastDemand.getLayer(), maxIconSize); egressNodes.add(egressNode);
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)
totalOfferedTraffic += d.getOfferedTraffic(); totalBlockedTraffic += d.getBlockedTraffic(); final boolean travOversuscribedLink = d.isTraversingOversubscribedLinks(); final boolean hasExcessiveLatency = (maximumE2ELatencyMs.getDouble() > 0) && (d.getWorseCasePropagationTimeInMs() > maximumE2ELatencyMs.getDouble()); if (considerTrafficInOversubscribedLinksAsLost.getBoolean()) totalTrafficOfDemandsTraversingOversubscribedLinks += travOversuscribedLink? d.getOfferedTraffic() : 0; if (hasExcessiveLatency) totalTrafficOfDemandsWithExcessiveWorseCaseLatency += d.getOfferedTraffic(); if (hasExcessiveLatency || (considerTrafficInOversubscribedLinksAsLost.getBoolean() && travOversuscribedLink)) totalBlockedConsideringUserDefinedExtraLimitations += d.getOfferedTraffic(); else totalBlockedConsideringUserDefinedExtraLimitations += d.getBlockedTraffic(); if (d.getBlockedTraffic() < PRECISION_FACTOR) numberOfDemandsWithoutBlocking ++;
throw new Net2PlanException("Some links in the link set provided are not traversed. The structure may not be a tree. Link set: " + linkSet + ". Traversed links: " + actuallyTraversedLinks + ". Demand ingress: " + demand.getIngressNode() + ", demand egress nodes: " + demand.getEgressNodes());
if (!nodesToKeep.contains(d.getIngressNode()) || !nodesToKeep.containsAll(d.getEgressNodes())) continue; d.getMulticastTrees().stream().forEach(t->nodesThisIteration.addAll(t.getNodeSet()));