/** * <p>Returns {@code true} if the initial set of {@link com.net2plan.interfaces.networkDesign.Link Links} of the tree when it was created is not subject to any failure: traversed links * and {@link com.net2plan.interfaces.networkDesign.Node Nodes} exist (were not removed) and are up. Returns {@code false} otherwise.</p> * @return See description above */ public boolean isUpTheInitialLinkSet () { checkAttachedToNetPlanObject(); if (!demand.ingressNode.isUp) return false; for (Link e : initialSetLinksWhenWasCreated) { if (e.netPlan != netPlan) return false; if (!e.destinationNode.isUp) return false; if (!e.isUp) return false; } return true; }
/** * <p>Returns the number of hops of the longest path (in number of hops) from the ingress {@link com.net2plan.interfaces.networkDesign.Node Node} to the egress nodes.</p> * @return The maximum end to end number of hops of the tree */ public int getTreeMaximumPathLengthInHops () { checkAttachedToNetPlanObject(); int max = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) max = Math.max(max, seqLinks.size()); return max; }
/** * <p>Returns the average number of hops among the paths from the ingress {@link com.net2plan.interfaces.networkDesign.Node Node} to the egress nodes.</p> * @return The average number of hops among the paths from ingress node to egress nodes */ public double getTreeAveragePathLengthInHops () { checkAttachedToNetPlanObject(); int accum = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) accum += seqLinks.size(); return ((double) accum) / demand.egressNodes.size(); }
/** * <p>Returns the average length in kms among the paths from the ingress node to each of the reachable egress nodes.</p> * @return see above */ public double getTreeAveragePathLengthInKm () { checkAttachedToNetPlanObject(); double accum = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) for (Link e : seqLinks) accum += e.getLengthInKm(); return accum / demand.egressNodes.size(); }
/** * <p>Returns the average propagation delay in miliseconds among the paths from the ingress {@link com.net2plan.interfaces.networkDesign.Node Node} to the egress nodes.</p> * @return Te average propagation delay ins ms among the pahs from the ingress node to the egress nodes */ public double getTreeAveragePropagationDelayInMs () { checkAttachedToNetPlanObject(); double accum = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) for (Link e : seqLinks) accum += e.getPropagationDelayInMs(); return accum / demand.egressNodes.size(); }
/** * <p>Returns the length in kms of the longest path from the ingress node to the reachable egress nodes.</p> * @return see above */ public double getTreeMaximumPathLengthInKm () { checkAttachedToNetPlanObject(); double max = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) { double accum = 0; for (Link e : seqLinks) accum += e.getLengthInKm(); max = Math.max(max, accum); } return max; }
/** * <p>Returns the propagation delay in milliseconds of the longest (in terms of propagation delay) path from the * ingress node to the reachable egress nodes.</p> * @return The maximum end to end propagation delay in milliseconds */ public double getTreeMaximumPropagationDelayInMs () { checkAttachedToNetPlanObject(); double max = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) { double accum = 0; for (Link e : seqLinks) accum += e.getPropagationDelayInMs(); max = Math.max(max, accum); } return max; }
/** * <p>Returns the {@link com.net2plan.interfaces.networkDesign.SharedRiskGroup SharedRiskGroups} (SRGs) the multicast tree is affected by.</p> * @return The {@code Set} of affecting SRGs, or an empty {@code Set} if none */ public Set<SharedRiskGroup> getSRGs () { checkAttachedToNetPlanObject(); Set<SharedRiskGroup> res = new TreeSet<SharedRiskGroup> (); for (Link e : linkSet) res.addAll (e.getSRGs()); for (Node n : cache_traversedNodes) res.addAll (n.getSRGs()); return res; }
/** * <p>Returns the sum of the {@link com.net2plan.interfaces.networkDesign.Link Links} length in kms of the tree.</p> * @return The tree total length in km */ public double getTreeTotalLengthInKm () { checkAttachedToNetPlanObject(); double accum = 0; for (Link e : getLinkSet()) accum += e.getLengthInKm(); return accum; }
/** * <p>Removes this multicast tree.</p> */ public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); setCarriedTraffic(0, 0); netPlan.cache_id2MulticastTreeMap.remove(id); NetPlan.removeNetworkElementAndShiftIndexes(layer.multicastTrees , index); for (Link link : linkSet) link.cache_traversingTrees.remove(this); for (Node node : cache_traversedNodes) node.cache_nodeAssociatedulticastTrees.remove(this); demand.cache_multicastTrees.remove(this); layer.cache_multicastTreesDown.remove(this); layer.cache_multicastTreesTravLinkZeroCap.remove(this); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); }
checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); SortedMap<Node,List<Link>> newPathToEgressNodeOfReachedNodes = netPlan.checkMulticastTreeValidityForDemand (newLinkSet , demand).getFirst();
newOccupiedLinkCapacity = NetPlan.adjustToTolerance(newOccupiedLinkCapacity); checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if ((newCarriedTraffic < 0) || (newOccupiedLinkCapacity < 0)) throw new Net2PlanException ("Carried traffics and occupied link capacities must be non-negative");