/** * <p>Removes this multicast tree.</p> */ public void remove () { checkAttachedToNetPlanObject(); netPlan.checkIsModifiable(); setCarriedTraffic(0, 0); netPlan.cache_id2MulticastTreeMap.remove(id); NetPlan.removeNetworkElementAndShiftIndexes(layer.multicastTrees , index); for (Link link : linkSet) link.cache_traversingTrees.remove(this); for (Node node : cache_traversedNodes) node.cache_nodeAssociatedulticastTrees.remove(this); demand.cache_multicastTrees.remove(this); layer.cache_multicastTreesDown.remove(this); layer.cache_multicastTreesTravLinkZeroCap.remove(this); for (String tag : tags) netPlan.cache_taggedElements.get(tag).remove(this); final NetPlan npOld = this.netPlan; removeId(); if (ErrorHandling.isDebugEnabled()) npOld.checkCachesConsistency(); }
setCarriedTraffic(0, 0); layer.cache_multicastTreesDown.remove(this); layer.cache_multicastTreesTravLinkZeroCap.remove(this); setCarriedTraffic(currentCarriedTrafficIfAllOk, currentOccupiedCapacityIfAllOk); if (ErrorHandling.isDebugEnabled()) netPlan.checkCachesConsistency();
tree.setCarriedTraffic(tree.carriedTrafficIfNotFailing, tree.occupiedLinkCapacityIfNotFailing); // updates links since all are up ErrorHandling.setDebug(previousDebug); } else throw new RuntimeException("Bad");
if (treeTravZeroCapLinks) layer.cache_multicastTreesTravLinkZeroCap.add(tree); demand.addMulticastTree(tree); tree.setCarriedTraffic(carriedTraffic, occupiedLinkCapacity); if (ErrorHandling.isDebugEnabled()) this.checkCachesConsistency(); return tree;
t.setCarriedTraffic(other.getCarriedTrafficInNoFailureState(), other.getOccupiedLinkCapacityInNoFailureState());
/** * <p>Sets the vector of the multicast trees carried traffics and occupied link capacities, at the given layer. i-th vector corresponds to i-th index of the element. * If occupied link capacities are {@code null}, the same amount as the carried traffic is assumed. If no layer is provided, the defaulf layer is assumed.</p> * * @param carriedTraffic Carried traffic vector * @param occupiedLinkCapacity Occupied link capacity vector * @param optionalLayerParameter Network layer (optional) */ public void setVectorMulticastTreeCarriedTrafficAndOccupiedLinkCapacities(DoubleMatrix1D carriedTraffic, DoubleMatrix1D occupiedLinkCapacity, NetworkLayer... optionalLayerParameter) { carriedTraffic = NetPlan.adjustToTolerance(carriedTraffic); occupiedLinkCapacity = NetPlan.adjustToTolerance(occupiedLinkCapacity); checkIsModifiable(); NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); if (occupiedLinkCapacity == null) occupiedLinkCapacity = carriedTraffic; if (carriedTraffic.size() != layer.multicastTrees.size()) throw new Net2PlanException("Wrong veector size"); if (carriedTraffic.size() != occupiedLinkCapacity.size()) throw new Net2PlanException("Wrong veector size"); if (carriedTraffic.size() > 0) if (carriedTraffic.getMinLocation()[0] < 0) throw new Net2PlanException("Carried traffics must be greater or equal than zero"); if (occupiedLinkCapacity.size() > 0) if (occupiedLinkCapacity.getMinLocation()[0] < 0) throw new Net2PlanException("Occupied link capacities must be greater or equal than zero"); for (MulticastTree t : layer.multicastTrees) t.setCarriedTraffic(carriedTraffic.get(t.index), occupiedLinkCapacity.get(t.index)); if (ErrorHandling.isDebugEnabled()) this.checkCachesConsistency(); }