/** Removes this lightpath request. This automatically removes any lightpath realizing this request. * */ public void remove () { d.remove(); }
for (Demand e : new ArrayList<> (this.getDemands(thisLayer))) if (nodesThis_thisAndOther.contains(e.getIngressNode()) && nodesThis_thisAndOther.contains(e.getEgressNode())) e.remove(); for (MulticastDemand e : new ArrayList<> (this.getMulticastDemands(thisLayer))) if (nodesThis_thisAndOther.contains(e.getIngressNode()) && nodesThis_thisAndOther.containsAll(e.getEgressNodes()))
/** * <p>Removes all the demands defined in the given layer. If no layer is provided, default layer is assumed.</p> * * @param optionalLayerParameter Network layer (optional) */ public void removeAllDemands(NetworkLayer... optionalLayerParameter) { checkIsModifiable(); NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); for (Demand d : new ArrayList<Demand>(layer.demands)) d.remove(); if (ErrorHandling.isDebugEnabled()) this.checkCachesConsistency(); }
/** * <p>Removes a node, and any associated link, demand, route or forwarding rule.</p> */ public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); for (Resource resource : new LinkedList<Resource> (cache_nodeResources)) resource.remove(); for (MulticastTree tree : new LinkedList<MulticastTree> (cache_nodeAssociatedulticastTrees)) tree.remove (); for (Route route : new LinkedList<Route> (cache_nodeAssociatedRoutes)) route.remove (); for (SharedRiskGroup srg : new LinkedList<SharedRiskGroup> (cache_nodeNonDynamicSRGs)) srg.remove (); for (Link link : new LinkedList<Link> (cache_nodeIncomingLinks)) link.remove (); for (Link link : new LinkedList<Link> (cache_nodeOutgoingLinks)) link.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeIncomingDemands)) demand.remove (); for (Demand demand : new LinkedList<Demand> (cache_nodeOutgoingDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeIncomingMulticastDemands)) demand.remove (); for (MulticastDemand demand : new LinkedList<MulticastDemand> (cache_nodeOutgoingMulticastDemands)) demand.remove (); netPlan.cache_id2NodeMap.remove (id); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.nodes , this.index); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); }
/** * <p>Removes a layer, and any associated link, demand, route, or forwarding rule. If this layer is the default, the new default layer is the one with index 0 (the smallest identifier) </p> * * @param optionalLayerParameter Network layer (optional) */ public void removeNetworkLayer(NetworkLayer... optionalLayerParameter) { checkIsModifiable(); final NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); if (netPlan.layers.size() == 1) throw new Net2PlanException("At least one layer must exist"); for (Route route : new LinkedList<Route>(layer.routes)) route.remove(); for (MulticastTree tree : new LinkedList<MulticastTree>(layer.multicastTrees)) tree.remove(); for (Link link : new LinkedList<Link>(layer.links)) link.remove(); for (Demand demand : new LinkedList<Demand>(layer.demands)) demand.remove(); for (MulticastDemand demand : new LinkedList<MulticastDemand>(layer.multicastDemands)) demand.remove(); for (Node node : nodes) node.removeUrlNodeIcon(layer); for (String tag : layer.tags) this.cache_taggedElements.get(tag).remove(layer); netPlan.interLayerCoupling.removeVertex(layer); netPlan.cache_id2LayerMap.remove(layer.id); NetPlan.removeNetworkElementAndShiftIndexes(netPlan.layers, layer.index); if (netPlan.defaultLayer.equals(layer)) netPlan.defaultLayer = netPlan.layers.get(0); layer.removeId(); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); }
private Pair<Map<Demand,Demand>,Map<Route,Route>> initializeNetPlanLinksBidirDemandsAndRoutes (NetPlan np) { /* Remove lower half demands from np */ np.removeAllRoutes(); for (Node n1 : np.getNodes()) for (Node n2 : np.getNodes()) if (n1.getIndex () > n2.getIndex ()) for (Demand d : np.getNodePairDemands(n1, n2,false)) d.remove (); np.addRoutesFromCandidatePathList(netPlan.computeUnicastCandidatePathList(null , tcfa_maxNumberPathsPerDemand.getInt(), tcfa_maxPathLengthInKm.getDouble(), tcfa_maxPathNumberOfHops.getInt(), -1, -1, -1, -1 , null)); /* Add symmetric demands and routes */ Map<Demand,Demand> opposite_d = new HashMap<Demand,Demand> (); Map<Route,Route> opposite_r = new HashMap<Route,Route> (); for (Demand d : new HashSet<Demand> (np.getDemands())) { final Demand opDemand = np.addDemand(d.getEgressNode(), d.getIngressNode(), d.getOfferedTraffic(), RoutingType.SOURCE_ROUTING , null); opposite_d.put(d,opDemand); opposite_d.put(opDemand,d); for (Route r : new HashSet<Route> (d.getRoutes ())) { final Route oppRoute = np.addRoute(opDemand, r.getCarriedTraffic(), r.getOccupiedCapacity() , oppositeSeqLinks (r.getSeqLinks()), null); opposite_r.put(r,oppRoute); opposite_r.put(oppRoute,r); } } return Pair.of(opposite_d,opposite_r); }
/** * <p>Creates a new {@link com.net2plan.interfaces.networkDesign.Demand Demand} in the given layer, with same end nodes as the link, and then couples the link to the new created demand.</p> * @param newDemandLayer The layer where the demand will be created (and coupled to the link) * @param routingTypeDemand Routing type * @return The created demand */ public Demand coupleToNewDemandCreated (NetworkLayer newDemandLayer , RoutingType routingTypeDemand) { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); newDemandLayer.checkAttachedToNetPlanObject(this.netPlan); Demand newDemand = netPlan.addDemand(originNode , destinationNode , capacity , routingTypeDemand , null , newDemandLayer); try { newDemand.coupleToUpperOrSameLayerLink(this); } catch (RuntimeException e) { newDemand.remove (); throw e; } if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency(); return newDemand; }
final List<AjtRcMenu> res = new ArrayList<> (); res.add(new AjtRcMenu("Add demand", e->createLinkDemandGUI(NetworkElementType.DEMAND, getTableNetworkLayer () , callback), (a,b)->true, null)); res.add(new AjtRcMenu("Remove selected demands", e->getSelectedElements().forEach(dd->((Demand)dd).remove()) , (a,b)->b>0, null)); res.add(new AjtRcMenu("Set QoS type to selected demands", e->
switch (e.getNeType()) case DEMAND: ((Demand) e).remove(); break; case LAYER: np.removeNetworkLayer((NetworkLayer) e); break; case LINK: ((Link)e).remove(); break;
for (Demand d : new ArrayList<> (netPlan.getDemands())) if (d.getRoutes().isEmpty()) d.remove();
transponderTypeOfNewLps.remove(lpToRemove); d.remove(); if (DEBUG) { checkWaveOccupEqualsNp(currentNetPlan); checkClashing (currentNetPlan); }
ev.demand.remove (); } else if (event.getEventObject () instanceof SimEvent.DemandModify)