/** * <p>Changes the set of {@link com.net2plan.interfaces.networkDesign.Link Links} of the tree to the ones when the tree was created. That is, before any tree rerouting action was made.</p> * It is equivalent to {@code setLinks(getInitialLinkSet())}. Recall that if the new link set traverses failing link or nodes, its carried traffic and occupied link capacities drop to zero, and if not * they will be the base values in the "no failure state". Also, if the original tree now traverses links that were removed, an exception is thrown * @see #setLinks(Set) * @see #getInitialLinkSet() */ public void revertToInitialSetOfLinks () { this.setLinks(initialSetLinksWhenWasCreated); }
MulticastTree newTree = netPlan.addMulticastTree(demand , carriedTrafficIfNotFailing , occupiedLinkCapacityIfNotFailing , initialSetLinks_link , null); mapOldId2MulticastTree.put (treeId , newTree); newTree.setLinks(currentSetLinks_link); while(xmlStreamReader.hasNext())
t.setLinks(new TreeSet<> (currentLinkSet));
private void parseMulticastTree(NetPlan netPlan, long layerId) throws XMLStreamException { final long treeId = getLong ("id"); if (treeId >= netPlan.nextElementId.toLong()) throw new Net2PlanException ("A network element has an id higher than the nextElementId"); final long demandId = getLong ("demandId"); final double carriedTraffic = getDouble ("carriedTrafficIfNotFailing"); double occupiedCapacity = getDouble ("occupiedLinkCapacityIfNotFailing"); double carriedTrafficIfNotFailing = carriedTraffic; try { carriedTrafficIfNotFailing = getDouble ("carriedTrafficIfNotFailing"); } catch (Exception e) {} double occupiedLinkCapacityIfNotFailing = occupiedCapacity; try { occupiedLinkCapacityIfNotFailing = getDouble ("occupiedLinkCapacityIfNotFailing"); } catch (Exception e) {} if (occupiedCapacity < 0) occupiedCapacity = carriedTraffic; final MulticastDemand demand = netPlan.getMulticastDemandFromId(demandId); final Set<Link> initialSetLinks_link = getLinkSetFromIds(netPlan, getListLong ("initialSetLinks")); final Set<Link> currentSetLinks_link = getLinkSetFromIds(netPlan, getListLong ("currentSetLinks")); final MulticastTree newTree = netPlan.addMulticastTree(treeId , demand , carriedTrafficIfNotFailing , occupiedLinkCapacityIfNotFailing , initialSetLinks_link , null); newTree.setLinks(currentSetLinks_link); readAndAddAttributesToEndAndPdForNodes (newTree , "multicastTree"); }
private void parseMulticastTree(NetPlan netPlan, long layerId) throws XMLStreamException { final long treeId = getLong ("id"); if (treeId >= netPlan.nextElementId.toLong()) throw new Net2PlanException ("A network element has an id higher than the nextElementId"); final long demandId = getLong ("demandId"); final double carriedTraffic = getDouble ("carriedTrafficIfNotFailing"); double occupiedCapacity = getDouble ("occupiedLinkCapacityIfNotFailing"); double carriedTrafficIfNotFailing = carriedTraffic; try { carriedTrafficIfNotFailing = getDouble ("carriedTrafficIfNotFailing"); } catch (Exception e) {} double occupiedLinkCapacityIfNotFailing = occupiedCapacity; try { occupiedLinkCapacityIfNotFailing = getDouble ("occupiedLinkCapacityIfNotFailing"); } catch (Exception e) {} if (occupiedCapacity < 0) occupiedCapacity = carriedTraffic; final MulticastDemand demand = netPlan.getMulticastDemandFromId(demandId); final SortedSet<Link> initialSetLinks_link = getLinkSetFromIds(netPlan, getListLong ("initialSetLinks")); final SortedSet<Link> currentSetLinks_link = getLinkSetFromIds(netPlan, getListLong ("currentSetLinks")); final MulticastTree newTree = netPlan.addMulticastTree(treeId , demand , carriedTrafficIfNotFailing , occupiedLinkCapacityIfNotFailing , initialSetLinks_link , null); newTree.setLinks(currentSetLinks_link); newTree.setName(getStringOrDefault("name", "")); newTree.setDescription(getStringOrDefault("description", "")); readAndAddAttributesToEndAndPdForNodes (newTree , "multicastTree"); }