/** * <p>Returns the sum of the occupied link capacity by the traffic of the {@link com.net2plan.interfaces.networkDesign.MulticastTree Multicast Trees} traversing the link.</p> * @return The occupied link capacity (link capacity units) */ public double getMulticastOccupiedLinkCapacity() { double accum = 0; for (MulticastTree t : cache_traversingTrees) accum += t.getOccupiedLinkCapacity(); return accum; }
/** * <p>Returns a vector with the occupied capacity traffic per multicast tree, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.</p> * * @param optionalLayerParameter Network layer (optional) * @return The vector with the occupied capacity per multicast tree */ public DoubleMatrix1D getVectorMulticastTreeOccupiedCapacity(NetworkLayer... optionalLayerParameter) { NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); DoubleMatrix1D res = DoubleFactory1D.dense.make(layer.multicastTrees.size()); for (MulticastTree e : layer.multicastTrees) res.set(e.index, e.getOccupiedLinkCapacity()); return res; }
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; } }
String str_seqLinks = CollectionUtils.join(tree.linkSet, " , "); String treeInformation = String.format("mt%d (id %d), multicast demand: md%d (id %d), carried traffic: %.3g, occupied capacity: %.3g, links: %s, nodes: %s, attributes: %s", tree.index, tree.id, tree.demand.index, tree.demand.id, tree.getCarriedTraffic(), tree.getOccupiedLinkCapacity(), str_seqLinks, str_seqNodes, tree.attributes.isEmpty() ? "none" : tree.attributes); netPlanInformation.append(treeInformation); netPlanInformation.append(NEWLINE);
if (Math.abs(cache_totalOccupiedCapacity) > 1e-3) throw new RuntimeException ("Bad"); for (Route r : cache_traversingRoutes.keySet()) if ((r.getCarriedTraffic() != 0) || (r.getOccupiedCapacity(this) != 0)) throw new RuntimeException ("Bad"); for (MulticastTree r : cache_traversingTrees) if ((r.getCarriedTraffic() != 0) || (r.getOccupiedLinkCapacity() != 0)) throw new RuntimeException ("Bad"); check_totalOccupiedCapacity += tree.getOccupiedLinkCapacity(); final String qos = tree.getMulticastDemand().getQosType(); if (check_occupAndViolationPerQos.containsKey(qos)) check_occupAndViolationPerQos.put(qos , check_occupAndViolationPerQos.get(qos) + tree.getOccupiedLinkCapacity()); else check_occupAndViolationPerQos.put(qos , tree.getOccupiedLinkCapacity());
final DrawLine dlLink = new DrawLine(dnOrigin, dn, e, dnOrigin.posEast(), dn.posWest(), tree.getOccupiedLinkCapacity()); DrawLine.addLineToGraphics(g2d, dlLink, fontMetrics, regularInterlineSpacePixels); drawnLines.add(dlLink);
@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 (isUp) // from down to up if (tree.getOccupiedLinkCapacity() != 0) throw new RuntimeException("Bad"); if (tree.getCarriedTraffic() != 0) throw new RuntimeException("Bad"); tree.layer.cache_multicastTreesDown.remove(tree); } else if (tree.getOccupiedLinkCapacity() != tree.occupiedLinkCapacityIfNotFailing) throw new RuntimeException("Bad"); if (tree.getCarriedTraffic() != tree.carriedTrafficIfNotFailing) throw new RuntimeException("Bad");
final double occupiedCapacity = t.getOccupiedLinkCapacity(); final double carriedTraffic = t.getCarriedTraffic(); Pair<Double,Double> thisQosTypeInfoSoFar = res.get(qosType);