@Test public void testGetFirstAvailableNodeBeforeFailures() { assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n3); n3.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n2); n3.setFailureState(true); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n3); n1.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , null); n1.setFailureState(true); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n3); link12.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n1); link23.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n1); n3.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n1); link12.setFailureState(true); link23.setFailureState(true); n3.setFailureState(true); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n3); link23.setFailureState(false); assertEquals (r123a.getFirstAvailableNodeBeforeFailures() , n2); }
public Node getFirstAvailableNodeBeforeFailures() { Node firstAvailableNodeBeforeFailures = null; ListIterator<Link> it = cache_seqLinksRealPath.listIterator(); while(it.hasNext()) { Link link = it.next(); Node originNode = link.originNode; if (!originNode.isUp) break; firstAvailableNodeBeforeFailures = originNode; if (!link.isUp) break; else if (!it.hasNext()) if (link.destinationNode.isUp) firstAvailableNodeBeforeFailures = link.destinationNode; } return firstAvailableNodeBeforeFailures; }
Route extends NetworkElement { public Node getFirstAvailableNodeBeforeFailures() { Node firstAvailableNodeBeforeFailures = null; ListIterator<Link> it = cache_seqLinksRealPath.listIterator(); while(it.hasNext()) { Link link = it.next(); Node originNode = link.originNode; if (!originNode.isUp) break; firstAvailableNodeBeforeFailures = originNode; if (!link.isUp) break; else if (!it.hasNext()) if (link.destinationNode.isUp) firstAvailableNodeBeforeFailures = link.destinationNode; } return firstAvailableNodeBeforeFailures; } }
Route extends NetworkElement { public Node getFirstAvailableNodeBeforeFailures() { Node firstAvailableNodeBeforeFailures = null; ListIterator<Link> it = cache_seqLinksRealPath.listIterator(); while(it.hasNext()) { Link link = it.next(); Node originNode = link.originNode; if (!originNode.isUp) break; firstAvailableNodeBeforeFailures = originNode; if (!link.isUp) break; else if (!it.hasNext()) if (link.destinationNode.isUp) firstAvailableNodeBeforeFailures = link.destinationNode; } return firstAvailableNodeBeforeFailures; } Route(NetPlan netPlan , long id , int index , Demand demand , List<? extends NetworkElement> seqLinksAndResourcesTraversed , AttributeMap attributes); }
Route extends NetworkElement { public Node getFirstAvailableNodeBeforeFailures() { Node firstAvailableNodeBeforeFailures = null; ListIterator<Link> it = cache_seqLinksRealPath.listIterator(); while(it.hasNext()) { Link link = it.next(); Node originNode = link.originNode; if (!originNode.isUp) break; firstAvailableNodeBeforeFailures = originNode; if (!link.isUp) break; else if (!it.hasNext()) if (link.destinationNode.isUp) firstAvailableNodeBeforeFailures = link.destinationNode; } return firstAvailableNodeBeforeFailures; } Route(NetPlan netPlan , long id , int index , Demand demand , List<? extends NetworkElement> seqLinksAndResourcesTraversed , AttributeMap attributes); Route getBidirectionalPair(); void setBidirectionalPair(Route r); boolean isBidirectional(); Route createBidirectionalOppositePair(); boolean isServiceChain(); SortedSet<Route> getRoutesIAmBackup(); List<Route> getBackupRoutes(); Triple<Double,List<NetworkElement>,List<Double>> getInitialState(); List<NetworkElement> getPath(); List<NetworkElement> getOppositePath(); boolean isBackupRoute(); boolean hasBackupRoutes(); void addBackupRoute(Route backupRoute); void removeBackupRoute(Route backupRoute); double getCarriedTraffic(); double getOccupiedCapacity(NetworkElement ... e); double getCarriedTrafficInNoFailureState(); double getOccupiedCapacityInNoFailureState(NetworkElement ... e); Demand getDemand(); Node getEgressNode(); Node getFirstAvailableNodeAfterFailures(); Node getFirstAvailableNodeBeforeFailures(); Node getIngressNode(); NetworkLayer getLayer(); double getLengthInKm(); int getNumberOfHops(); double getPropagationDelayInMiliseconds(); double getPropagationSpeedInKmPerSecond(); List<Double> getSeqOccupiedCapacitiesIfNotFailing(); boolean isOccupyingDifferentCapacitiesInDifferentLinksInNoFailureState(); List<Resource> getSeqResourcesTraversed(); List<Link> getSeqLinks(); List<Node> getSeqNodes(); List<Node> getSeqIntermediateNodes(); int getNumberOfTimesIsTraversed(NetworkElement e); SortedSet<SharedRiskGroup> getSRGs(); boolean hasLoops(); boolean isDown(); boolean isTraversingZeroCapLinks(); void remove(); void setCarriedTraffic(double newCarriedTraffic , double newOccupiedLinkAndResourcesCapacities); void setCarriedTraffic(double newCarriedTraffic , List<Double> linkAndResourcesOccupationInformation); void setPath(double newCarriedTraffic , List<? extends NetworkElement> newPath , List<Double> newOccupationInformation); void setSeqLinks(List<Link> seqLinks); @Override String toString(); static List<Link> getSeqLinks(List<? extends NetworkElement> seqLinksAndResources); static List<Resource> getSeqResources(List<? extends NetworkElement> seqLinksAndResources); }
Route extends NetworkElement { public Node getFirstAvailableNodeBeforeFailures() { Node firstAvailableNodeBeforeFailures = null; ListIterator<Link> it = cache_seqLinksRealPath.listIterator(); while(it.hasNext()) { Link link = it.next(); Node originNode = link.originNode; if (!originNode.isUp) break; firstAvailableNodeBeforeFailures = originNode; if (!link.isUp) break; else if (!it.hasNext()) if (link.destinationNode.isUp) firstAvailableNodeBeforeFailures = link.destinationNode; } return firstAvailableNodeBeforeFailures; } Route(NetPlan netPlan , long id , int index , Demand demand , List<? extends NetworkElement> seqLinksAndResourcesTraversed , AttributeMap attributes); Route getBidirectionalPair(); void setBidirectionalPair(Route r); boolean isBidirectional(); Route createBidirectionalOppositePair(); boolean isServiceChain(); SortedSet<Route> getRoutesIAmBackup(); List<Route> getBackupRoutes(); Triple<Double,List<NetworkElement>,List<Double>> getInitialState(); List<NetworkElement> getPath(); List<NetworkElement> getOppositePath(); boolean isBackupRoute(); boolean hasBackupRoutes(); void addBackupRoute(Route backupRoute); void removeBackupRoute(Route backupRoute); double getCarriedTraffic(); double getOccupiedCapacity(NetworkElement ... e); double getCarriedTrafficInNoFailureState(); double getOccupiedCapacityInNoFailureState(NetworkElement ... e); Demand getDemand(); Node getEgressNode(); Node getFirstAvailableNodeAfterFailures(); Node getFirstAvailableNodeBeforeFailures(); Node getIngressNode(); NetworkLayer getLayer(); double getLengthInKm(); int getNumberOfHops(); double getPropagationDelayInMiliseconds(); double getPropagationSpeedInKmPerSecond(); List<Double> getSeqOccupiedCapacitiesIfNotFailing(); boolean isOccupyingDifferentCapacitiesInDifferentLinksInNoFailureState(); List<Resource> getSeqResourcesTraversed(); List<Link> getSeqLinks(); List<Node> getSeqNodes(); List<Node> getSeqIntermediateNodes(); int getNumberOfTimesIsTraversed(NetworkElement e); SortedSet<SharedRiskGroup> getSRGs(); boolean hasLoops(); boolean isDown(); boolean isTraversingZeroCapLinks(); void remove(); void setCarriedTraffic(double newCarriedTraffic , double newOccupiedLinkAndResourcesCapacities); void setCarriedTraffic(double newCarriedTraffic , List<Double> linkAndResourcesOccupationInformation); void setPath(double newCarriedTraffic , List<? extends NetworkElement> newPath , List<Double> newOccupationInformation); void setSeqLinks(List<Link> seqLinks); @Override String toString(); static List<Link> getSeqLinks(List<? extends NetworkElement> seqLinksAndResources); static List<Resource> getSeqResources(List<? extends NetworkElement> seqLinksAndResources);  }