@Test public void testGetAffectedRoutes() { assertEquals(srgL13.getAffectedRoutes(lowerLayer) , new TreeSet<Route> (Arrays.asList(segm13))); assertEquals(srgN1L23.getAffectedRoutes(lowerLayer) , new TreeSet<Route> (Arrays.asList(r12 , r123a, r123b, sc123 , segm13))); assertEquals(srgL13.getAffectedRoutes(upperLayer) , new TreeSet<Route> (Arrays.asList())); assertEquals(srgN1L23.getAffectedRoutes(upperLayer) , new TreeSet<Route> (Arrays.asList())); }
public SortedSet<Route> getAffectedRoutes (NetworkLayer layer) { SortedSet<Route> res = new TreeSet<Route> (); for (Link e : getLinksAllLayers()) for (Route r : e.cache_traversingRoutes.keySet()) if (r.layer.equals(layer)) res.add (r); for (Node n : getNodes()) for (Route r : n.cache_nodeAssociatedRoutes) if (r.layer.equals(layer)) res.add (r); return res; }
SharedRiskGroup extends NetworkElement { public SortedSet<Route> getAffectedRoutes (NetworkLayer layer) { SortedSet<Route> res = new TreeSet<Route> (); for (Link e : getLinksAllLayers()) for (Route r : e.cache_traversingRoutes.keySet()) if (r.layer.equals(layer)) res.add (r); for (Node n : getNodes()) for (Route r : n.cache_nodeAssociatedRoutes) if (r.layer.equals(layer)) res.add (r); return res; } }
SharedRiskGroup extends NetworkElement { public SortedSet<Route> getAffectedRoutes (NetworkLayer layer) { SortedSet<Route> res = new TreeSet<Route> (); for (Link e : getLinksAllLayers()) for (Route r : e.cache_traversingRoutes.keySet()) if (r.layer.equals(layer)) res.add (r); for (Node n : getNodes()) for (Route r : n.cache_nodeAssociatedRoutes) if (r.layer.equals(layer)) res.add (r); return res; } SharedRiskGroup(NetPlan netPlan , long id , int index , SortedSet<Node> nodes , SortedSet<Link> links , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes);   SharedRiskGroup(NetPlan netPlan , long id , int index , String className , String dynamicInitializationString , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes); }
SharedRiskGroup extends NetworkElement { public SortedSet<Route> getAffectedRoutes (NetworkLayer layer) { SortedSet<Route> res = new TreeSet<Route> (); for (Link e : getLinksAllLayers()) for (Route r : e.cache_traversingRoutes.keySet()) if (r.layer.equals(layer)) res.add (r); for (Node n : getNodes()) for (Route r : n.cache_nodeAssociatedRoutes) if (r.layer.equals(layer)) res.add (r); return res; } SharedRiskGroup(NetPlan netPlan , long id , int index , SortedSet<Node> nodes , SortedSet<Link> links , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes);   SharedRiskGroup(NetPlan netPlan , long id , int index , String className , String dynamicInitializationString , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes); boolean isDynamicSrg(); DynamicSrgImplementation getDynamicSrgImplementation(); void setDynamicImplementation(DynamicSrgImplementation impl); boolean isStaticEmptySrg(); boolean isDynamicCurrentlyEmptySrg(); static SharedRiskGroup getDummyEmptyStaticSrg(NetPlan np); static SortedSet<SharedRiskGroup> getSrgListCompletedWithDummyNoFailureStateIfNeeded(Collection<SharedRiskGroup> sourceSrgs , NetPlan np); SortedSet<Node> getNodes(); SortedSet<Link> getAffectedLinksAllLayers(); SortedSet<Link> getAffectedLinks(NetworkLayer layer); SortedSet<Route> getAffectedRoutesAllLayers(); SortedSet<Route> getAffectedRoutes(NetworkLayer layer); SortedSet<MulticastTree> getAffectedMulticastTreesAllLayers(); SortedSet<MulticastTree> getAffectedMulticastTrees(NetworkLayer layer); boolean affectsAnyOf(Collection<? extends NetworkElement> col); SortedSet<Link> getLinksAllLayers(); SortedSet<Link> getLinks(NetworkLayer layer); double getMeanTimeToFailInHours(); void setMeanTimeToFailInHours(double value); double getMeanTimeToRepairInHours(); void setMeanTimeToRepairInHours(double value); double getAvailability(); void setAsDown(); void setAsUp(); void removeLink(Link e); void removeNode(Node n); void remove(); void addLink(Link link); void addNode(Node node); String toString(); }
SharedRiskGroup extends NetworkElement { public SortedSet<Route> getAffectedRoutes (NetworkLayer layer) { SortedSet<Route> res = new TreeSet<Route> (); for (Link e : getLinksAllLayers()) for (Route r : e.cache_traversingRoutes.keySet()) if (r.layer.equals(layer)) res.add (r); for (Node n : getNodes()) for (Route r : n.cache_nodeAssociatedRoutes) if (r.layer.equals(layer)) res.add (r); return res; } SharedRiskGroup(NetPlan netPlan , long id , int index , SortedSet<Node> nodes , SortedSet<Link> links , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes);   SharedRiskGroup(NetPlan netPlan , long id , int index , String className , String dynamicInitializationString , double meanTimeToFailInHours ,  double meanTimeToRepairInHours , AttributeMap attributes); boolean isDynamicSrg(); DynamicSrgImplementation getDynamicSrgImplementation(); void setDynamicImplementation(DynamicSrgImplementation impl); boolean isStaticEmptySrg(); boolean isDynamicCurrentlyEmptySrg(); static SharedRiskGroup getDummyEmptyStaticSrg(NetPlan np); static SortedSet<SharedRiskGroup> getSrgListCompletedWithDummyNoFailureStateIfNeeded(Collection<SharedRiskGroup> sourceSrgs , NetPlan np); SortedSet<Node> getNodes(); SortedSet<Link> getAffectedLinksAllLayers(); SortedSet<Link> getAffectedLinks(NetworkLayer layer); SortedSet<Route> getAffectedRoutesAllLayers(); SortedSet<Route> getAffectedRoutes(NetworkLayer layer); SortedSet<MulticastTree> getAffectedMulticastTreesAllLayers(); SortedSet<MulticastTree> getAffectedMulticastTrees(NetworkLayer layer); boolean affectsAnyOf(Collection<? extends NetworkElement> col); SortedSet<Link> getLinksAllLayers(); SortedSet<Link> getLinks(NetworkLayer layer); double getMeanTimeToFailInHours(); void setMeanTimeToFailInHours(double value); double getMeanTimeToRepairInHours(); void setMeanTimeToRepairInHours(double value); double getAvailability(); void setAsDown(); void setAsUp(); void removeLink(Link e); void removeNode(Node n); void remove(); void addLink(Link link); void addNode(Node node); String toString();  }