/** Get the propagation delay given a list of Fibers to traverse. * @param fiberLinks see above * @return see above */ public double getPropagationDelay(List<WFiber> fiberLinks) { double propagationDelay = 0; for(WFiber fiber : fiberLinks) { propagationDelay = propagationDelay + fiber.getNe().getPropagationDelayInMs(); } return propagationDelay; }
/** * <p>Returns the average propagation delay in miliseconds among the paths from the ingress {@link com.net2plan.interfaces.networkDesign.Node Node} to the egress nodes.</p> * @return Te average propagation delay ins ms among the pahs from the ingress node to the egress nodes */ public double getTreeAveragePropagationDelayInMs () { checkAttachedToNetPlanObject(); double accum = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) for (Link e : seqLinks) accum += e.getPropagationDelayInMs(); return accum / demand.egressNodes.size(); }
/** * <p>Returns the propagation delay in milliseconds of the longest (in terms of propagation delay) path from the * ingress node to the reachable egress nodes.</p> * @return The maximum end to end propagation delay in milliseconds */ public double getTreeMaximumPropagationDelayInMs () { checkAttachedToNetPlanObject(); double max = 0; for (List<Link> seqLinks : pathToReachableEgressNode.values()) { double accum = 0; for (Link e : seqLinks) accum += e.getPropagationDelayInMs(); max = Math.max(max, accum); } return max; }
void updatePropagationAndProcessingDelayInMiliseconds () { this.cache_propagationDelayMs = 0; double thisRouteLengthKm = 0; for (NetworkElement e : currentPath) { if (e instanceof Link) { cache_propagationDelayMs += ((Link) e).getPropagationDelayInMs(); thisRouteLengthKm += ((Link) e).getLengthInKm(); } else if (e instanceof Resource) cache_propagationDelayMs += ((Resource) e).processingTimeToTraversingTrafficInMs; } demand.cache_worstCasePropagationTimeMs = Math.max(demand.cache_worstCasePropagationTimeMs, this.cache_propagationDelayMs); demand.cache_worstCaseLengthInKm = Math.max(demand.cache_worstCaseLengthInKm, thisRouteLengthKm); if (demand.coupledUpperOrSameLayerLink != null) demand.coupledUpperOrSameLayerLink.updateWorstCasePropagationTraversingUnicastDemandsAndMaybeRoutes(); }
/** * <p>Returns a vector with the propagation delay in milliseconds in the links, at the given layer. i-th vector corresponds to i-th index of the element. If no layer is provided, the defaulf layer is assumed.</p> * * @param optionalLayerParameter Network layer (optional) * @return The vector with the propagation time per link */ public DoubleMatrix1D getVectorLinkPropagationDelayInMiliseconds(NetworkLayer... optionalLayerParameter) { NetworkLayer layer = checkInThisNetPlanOptionalLayerParameter(optionalLayerParameter); DoubleMatrix1D res = DoubleFactory1D.dense.make(layer.links.size()); for (Link e : layer.links) res.set(e.index, e.getPropagationDelayInMs()); return res; }
cost = optionalCostMapOrElseLatency.get().getOrDefault(new WFiber(e), e.getPropagationDelayInMs()); else cost = e.getPropagationDelayInMs(); linkCostMap.put(e, cost);
/** Returns the propagation delay in ms of this link. If the link is NOT coupled, this is the user-defined length divided by * the user defined propagatio speed. If it is coupled, the length is computed from the physical propagation delay of the fibers * traversed by the lightpath carrying this link. If the lightpath is 1+1 protected, the longest path propagation delay is returned. * @return see above */ public double getWorstCasePropagationDelayInMs () { if (this.isCoupledtoLpRequest()) return getCoupledLpRequest().getWorstCasePropagationDelayMs(); return npLink.getPropagationDelayInMs(); }
@Override public boolean acceptPath(GraphPath<Link> candidate) { if (maxNumHops != Integer.MAX_VALUE && candidate.getPathLength() > maxNumHops) return false; if (maxLengthInKm == Double.MAX_VALUE && maxPropDelayInMs == Double.MAX_VALUE) return true; double pathLengthInKm = 0; double pathPropDelayInMs = 0; for (Link link : candidate.getPath()) { pathLengthInKm += link.getLengthInKm(); pathPropDelayInMs += link.getPropagationDelayInMs(); } return pathLengthInKm <= maxLengthInKm && pathPropDelayInMs <= maxPropDelayInMs; }
temp.append("<tr><td>Link utilization:</td><td>" + String.format("%.2f" , npLink.getUtilization()) + "</td></tr>"); temp.append("<tr><td>Destination layer:</td><td>" + getLayerName(destinationNode.getLayer()) + "</td></tr>"); temp.append("<tr><td>Link length:</td><td>" + String.format("%.2f" , npLink.getLengthInKm()) + " km (" + String.format("%.2f" , npLink.getPropagationDelayInMs()) + " ms)" + "</td></tr>"); temp.append("</table>"); temp.append("</html>");
if (splitFactor == null) continue; if (splitFactor == 0) continue; final double thisPathCost_wc = wcSoFar.getFirst() + e.getPropagationDelayInMs(); final double thisPathCost_length = wcSoFar.getSecond() + e.getLengthInKm(); if (inNodes.containsKey(e.getDestinationNode()))
DrawLine(DrawNode from, DrawNode to, Link e, Point pFrom, Point pTo, double occupiedToShow) { final String capUnits = e.getNetPlan().getLinkCapacityUnitsName(e.getLayer()); this.from = from; this.to = to; this.pFrom = pFrom; this.pTo = pTo; this.labels = new ArrayList<>(); this.urlsLabels = new ArrayList<>(); final DecimalFormat df = new DecimalFormat("###.##"); String length_km = df.format((e.getLengthInKm() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getLengthInKm()); String delay_ms = df.format((e.getPropagationDelayInMs() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getPropagationDelayInMs()); this.labels.addAll(Arrays.asList( "Link " + e.getIndex() , length_km + " km (" + delay_ms + " ms)" , "Occup: " + String.format("%.1f" , occupiedToShow) + " " + capUnits, "Total: " + String.format("%.1f" , e.getOccupiedCapacity()) + "/" + String.format("%.1f" , e.getCapacity()) + " " + capUnits )); this.urlsLabels.addAll(Arrays.asList("link" + e.getId(), "", "", "")); if (e.getCoupledDemand() != null) { labels.add("Coupled: Demand " + e.getCoupledDemand().getIndex() + ", " + getLayerName(e.getCoupledDemand().getLayer())); urlsLabels.add("demand" + e.getCoupledDemand().getId()); } else if (e.getCoupledMulticastDemand() != null) { labels.add("Coupled: Multicast demand " + e.getCoupledMulticastDemand().getIndex() + ", " + getLayerName(e.getCoupledMulticastDemand().getLayer())); urlsLabels.add("multicastDemand" + e.getCoupledMulticastDemand().getId()); } this.associatedElement = e; }
/** * Creates a link in the opposite direction as this, and with the same attributes, and associate both as bidirectional pairs. * If this link is already a bidirectional link, makes nothing and returns null * @return the newly created link */ public Link createBidirectionalPair () { checkAttachedToNetPlanObject(); if (this.isBidirectional()) return null; final Link e = netPlan.addLink(this.destinationNode, this.originNode, this.getCapacity(), this.getLengthInKm(), this.getPropagationDelayInMs(), this.attributes, this.layer); this.bidirectionalPair = e; e.bidirectionalPair = this; return e; }
res.add(new AjtColumnInfo<Link>(this , Double.class, null , "Length (km)", "Link length in km, considering the worst case lower layer propagation", null , d->d.getLengthInKm() , AGTYPE.SUMDOUBLE, null)); res.add(new AjtColumnInfo<Link>(this , Double.class, null , "Prop. speed (km/sec)", "Link average propagation speed in km per second", (d,val)->{ if (!d.isCoupled()) d.setPropagationSpeedInKmPerSecond((Double)val); } , d->d.getPropagationSpeedInKmPerSecond() , AGTYPE.NOAGGREGATION, null)); res.add(new AjtColumnInfo<Link>(this , Double.class, null , "Prop. delay (ms)", "Link propagation delay in ms, considering the worst case lower layer propagation of the traffic", null , d->d.getPropagationDelayInMs() , AGTYPE.MAXDOUBLE, null)); res.add(new AjtColumnInfo<Link>(this , Collection.class, null , "Routes", "Traversing routes", null , d->d.getTraversingRoutes() , AGTYPE.NOAGGREGATION, null)); res.add(new AjtColumnInfo<Link>(this , Collection.class, null , "Forw. rules", "Forwarding rules defined for this link", null , d->d.getForwardingRules().keySet() , AGTYPE.NOAGGREGATION, null));
double length_km = (e.getLengthInKm() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getLengthInKm(); res.add(Triple.of("Length (km)", "" + df.format(length_km), "")); double delay_ms = (e.getPropagationDelayInMs() == Double.MAX_VALUE) ? Double.POSITIVE_INFINITY : e.getPropagationDelayInMs(); res.add(Triple.of("Delay (ms)", "" + df.format(delay_ms), "")); res.add(Triple.of("# routes (total / backup)", "" + e.getTraversingRoutes().size() + " / " + e.getTraversingBackupRoutes().size(), ""));
for(WFiber fiber : firstFiberLinks) { System.out.print(" #" + truncate(fiber.getLengthInKm(), 2) + "km,(" + truncate(fiber.getNe().getPropagationDelayInMs(), 2) + "ms)# " + fiber.getB().getName());
T_e_prop [e.getIndex()] = e.getPropagationDelayInMs(); T_e_tx [e.getIndex()] = 1000 * averagePacketLength_bits.getDouble() / (e.getCapacity() * linkCapacityUnits_bps.getDouble()); T_e_buf [e.getIndex()] = 1000 * averagePacketLength_bits.getDouble() / (e.getCapacity() * linkCapacityUnits_bps.getDouble()) * Math.pow(rho_e, 1/(2*(1-hurstParameter.getDouble()))) / Math.pow(1-rho_e , hurstParameter.getDouble()/(1 - hurstParameter.getDouble()));
e.setCapacity(other.getCapacity()); e.setLengthInKm(other.getLengthInKm()); e.setPropagationSpeedInKmPerSecond(other.getPropagationDelayInMs()); e.setFailureState(!other.isDown());
p_e.set(e.getIndex(), e.getPropagationDelayInMs()); op.setInputParameter("p_e", p_e, "row"); op.addConstraint("p_e * x_et <= " + maxE2EPropDelayInMs);
prop_e.set(e.getIndex(), e.getPropagationDelayInMs()); op.setInputParameter("p_e", prop_e, "row"); op.addConstraint("p_e * x_et <= " + maxE2EPropDelayInMs);