/** * <p>Sets the failure state (up or down) for all the nodes.</p> * * @param setAsUp {@code true} up, {@code false} down */ public void setAllNodesFailureState(boolean setAsUp) { checkIsModifiable(); if (setAsUp) setLinksAndNodesFailureState(null, null, nodes, null); else setLinksAndNodesFailureState(null, null, null, nodes); }
/** * <p>Sets the failure state (up or down) for all the links in the given layer. If no layer is provided, the default layer is assumed.</p> * * @param setAsUp {@code true} up, {@code false} down * @param optionalLayerParameter Network layer (optional) */ public void setAllLinksFailureState(boolean setAsUp, NetworkLayer... optionalLayerParameter) { checkIsModifiable(); NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); if (setAsUp) setLinksAndNodesFailureState(layer.links, null, null, null); else setLinksAndNodesFailureState(null, layer.links, null, null); }
/** * <p>Sets the failure state of the link: up or down and returns the previous failure state. The routing is updated if the failure state changed.</p> * @param setAsUp The new failure state: {@code true} if up, {@code false} if down * @return the previous failure state */ public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (this.isUp == setAsUp) return this.isUp; List<Link> aux = new LinkedList<Link> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (aux , null , null , null); else netPlan.setLinksAndNodesFailureState (null, aux , null , null); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; // the previous state }
/** * <p>SortedSet the failure state of the node: up or down. Returns the previous failure state. The routing is automatically updated, making the traffic * of the traversing routes as zero, and the hop-by-hop routing is updated as if the forwarding rules of input and output links were zero</p> * @param setAsUp The new failure state ({@code true} up, {@code false} down) * @return The previous failure state */ public boolean setFailureState (boolean setAsUp) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (isUp == setAsUp) return isUp; List<Node> aux = new LinkedList<Node> (); aux.add(this); if (setAsUp) netPlan.setLinksAndNodesFailureState (null , null , aux , null); else netPlan.setLinksAndNodesFailureState (null, null , null , aux); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return !setAsUp; // the previous state }
/** * <p>Sets nodes and links associated to the SRG as down (in case they are not yet). The network state is updated with the affected routes, * segments, trees and hop-by-hop routing associated to the new nodes/links down </p> */ public void setAsDown () { checkAttachedToNetPlanObject(); netPlan.setLinksAndNodesFailureState (null , getLinksAllLayers() , null , getNodes ()); }
/** * <p>Sets nodes and links associated to the SRG as up (in case they are not yet). The network state is updated with the affected routes, * segments, trees and hop-by-hop routing associated to the new nodes/links down </p> */ public void setAsUp () { checkAttachedToNetPlanObject(); netPlan.setLinksAndNodesFailureState (getLinksAllLayers() , null , getNodes (), null); }
/** Returns true if the given design is tolerant to single SRG failures at the given layer: that is, no traffic of any * unicast not multicast demand is blocked when such SRG fails * @param np the design * @param failureTolerantLayer the layer where we check tolerance * @return see above */ public static boolean isSingleSRGFailureTolerant (NetPlan np , NetworkLayer failureTolerantLayer) { final SortedSet<Node> originalNpFailingNodes = new TreeSet<> (np.getNodesDown()); final SortedSet<Link> originalNpFailingLinks = new TreeSet<> (np.getLinksDownAllLayers()); np.setLinksAndNodesFailureState(originalNpFailingLinks , null , originalNpFailingNodes , null); final double precFactor = Configuration.precisionFactor; if (failureTolerantLayer.getNetPlan() != np) throw new Net2PlanException ("The input layer does not belong to the input NetPlan"); for (SharedRiskGroup srg : np.getSRGs()) { srg.setAsDown(); if (np.getVectorDemandBlockedTraffic(failureTolerantLayer).zSum() > precFactor) return false; if (np.getVectorMulticastDemandBlockedTraffic(failureTolerantLayer).zSum() > precFactor) return false; if (np.getVectorLinkOversubscribedTraffic(failureTolerantLayer).zSum() > precFactor) return false; srg.setAsUp(); } np.setLinksAndNodesFailureState(null, originalNpFailingLinks , null , originalNpFailingNodes); return true; }
currentNetPlan.setLinksAndNodesFailureState(ev.linksToUp , ev.linksToDown , ev.nodesToUp , ev.nodesToDown); routesFromDownToUp.removeAll(currentNetPlan.getRoutesDown());
currentNetPlan.setLinksAndNodesFailureState(ev.linksToUp , ev.linksToDown , ev.nodesToUp , ev.nodesToDown); routesFromDownToUp.removeAll(currentNetPlan.getRoutesDown(wdmLayer));
currentNetPlan.setLinksAndNodesFailureState(ev.linksToUp , ev.linksToDown , ev.nodesToUp , ev.nodesToDown);