@Override public NetPlan readDemandSetFromFile(File file) { NetPlan netPlan = readFromFile(file); for (NetworkLayer layer : netPlan.getNetworkLayers ()) if (!layer.equals(netPlan.getNetworkLayerDefault())) netPlan.removeNetworkLayer (layer); netPlan.removeAllLinks(); netPlan.removeAllUnicastRoutingInformation(); netPlan.removeAllSRGs(); return netPlan; }
@Override public void saveDemandSetToFile(NetPlan netPlan, File file) { for (NetworkLayer layer : netPlan.getNetworkLayers ()) if (!layer.equals(netPlan.getNetworkLayerDefault())) netPlan.removeNetworkLayer (layer); netPlan.removeAllLinks(); netPlan.removeAllUnicastRoutingInformation(); netPlan.removeAllSRGs(); netPlan.saveToFile(file); }
initialNetPlan.removeAllUnicastRoutingInformation(layer); initialNetPlan.removeAllMulticastTrees(layer);
netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands (RoutingType.HOP_BY_HOP_ROUTING);
this.E = netPlan.getNumberOfLinks(); if (N == 0) throw new Net2PlanException("The input design must have nodes"); netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands (RoutingType.HOP_BY_HOP_ROUTING);
final int E = netPlan.getNumberOfLinks(); if (N == 0) throw new Net2PlanException("The input design must have nodes"); netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands (RoutingType.HOP_BY_HOP_ROUTING);
this.stat_pie = new TimeTrace (); netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands(RoutingType.HOP_BY_HOP_ROUTING);
final int E = netPlan.getNumberOfLinks(); if (N == 0) throw new Net2PlanException("The input design must have nodes"); netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands (RoutingType.HOP_BY_HOP_ROUTING);
currentNetPlan.removeAllUnicastRoutingInformation(); currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING); this.currentNetPlan.addRoutesFromCandidatePathList(currentNetPlan.computeUnicastCandidatePathList(currentNetPlan.getVectorLinkLengthInKm() , 1, -1, -1, -1, -1, -1, -1 , null));
currentNetPlan.removeAllUnicastRoutingInformation(); currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING); this.currentNetPlan.addRoutesFromCandidatePathList(currentNetPlan.computeUnicastCandidatePathList(null , control_maxNumberOfPathsPerDemand.getInt(), -1, -1, -1, -1, -1, -1 , null));
this.stat_mapRouteId2CarriedPacketsLastInterval = new HashMap<Route,Integer> (); this.currentNetPlan.removeAllUnicastRoutingInformation(); this.currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING); final Pair<NetPlan,double [][]> pOpt = computeOptimumSolution (false);
private static void checkSolution(NetPlan netPlan, DoubleMatrix2D xx_de , DoubleMatrix3D xx_des) { if (!netPlan.getLinksOversubscribed().isEmpty()) throw new Net2PlanException("Bad - Some link is oversubscribed (constraint violated)"); if (!netPlan.getDemandsBlocked().isEmpty()) throw new Net2PlanException("Bad - Some demand is blocked (constraint violated)"); for (SharedRiskGroup srg : netPlan.getSRGs()) { NetPlan npThis = netPlan.copy (); npThis.removeAllUnicastRoutingInformation(); DoubleMatrix2D this_xxde = xx_des.viewColumn (srg.getIndex ()).copy (); for (Link e : srg.getAffectedLinksAllLayers()) if (this_xxde.viewColumn(e.getIndex ()).zSum () != 0) throw new Net2PlanException("Bad - some failing links carry traffic"); npThis.setRoutingFromDemandLinkCarriedTraffic(this_xxde , true , false , null); if (!npThis.getLinksOversubscribed().isEmpty()) throw new Net2PlanException("Bad - Some link is oversubscribed (constraint violated) in a failure"); if (!npThis.getDemandsBlocked().isEmpty()) throw new Net2PlanException("Bad - Some demand is blocked (constraint violated) in a failure"); for (Demand d : netPlan.getDemands ()) { IntArrayList es_noFailure = new IntArrayList (); xx_de.viewRow (d.getIndex ()).getNonZeros(es_noFailure , new DoubleArrayList ()); boolean affectedByThisFailure = false; for (Link e : srg.getAffectedLinksAllLayers()) if (xx_de.get(d.getIndex() , e.getIndex ()) != 0) { affectedByThisFailure = true; break; } if (!affectedByThisFailure) { IntArrayList es_thisFailure = new IntArrayList (); this_xxde.viewRow (d.getIndex ()).getNonZeros(es_thisFailure , new DoubleArrayList ()); if (!es_noFailure.equals(es_thisFailure)) throw new Net2PlanException("Routing cannot change when a demand is not affected by the failure"); } } } } }
this.currentNetPlan.removeAllUnicastRoutingInformation(); this.currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING);
np.removeAllUnicastRoutingInformation(); np.setVectorDemandOfferedTraffic(h_d_array); np.setRoutingFromDemandLinkCarriedTraffic(x_de_array , false , false , null);
netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING);
currentNetPlan.removeAllUnicastRoutingInformation(); currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING); this.currentNetPlan.addRoutesFromCandidatePathList(currentNetPlan.computeUnicastCandidatePathList(null , control_maxNumberOfPathsPerDemand.getInt(), -1, -1, -1, -1, -1, -1 , null));
currentNetPlan.removeAllUnicastRoutingInformation(); currentNetPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING); this.currentNetPlan.addRoutesFromCandidatePathList(currentNetPlan.computeUnicastCandidatePathList(currentNetPlan.getVectorLinkLengthInKm() , 1, -1, -1, -1, -1, -1, -1 , null));
np.removeAllUnicastRoutingInformation(); np.setRoutingFromDemandLinkCarriedTraffic(x_de_array , xdeVariablesAsFractionsOfTraffic , false , null);
netPlan.removeAllUnicastRoutingInformation(); netPlan.setRoutingTypeAllDemands(RoutingType.SOURCE_ROUTING);