+ // SRLG length is expressed in OR topology in meter
+ var entryAug = entry.getValue().augmentation(LinkConcatenation1.class);
+ linkCd += entry.getValue().getSRLGLength().doubleValue() / 1000.0
+ * retrieveCdFromFiberType(entryAug.getFiberType());
+ if (entryAug.getPmd() == null
+ || entryAug.getPmd().getValue().doubleValue() == 0.0
+ || entryAug.getPmd().getValue().toString().isEmpty()) {
+ linkPmd2 += Math.pow(
+ entry.getValue().getSRLGLength().doubleValue() / 1000.0
+ * retrievePmdFromFiberType(entryAug.getFiberType()),
+ 2);
+ } else {
+ linkPmd2 += Math.pow(entryAug.getPmd().getValue().doubleValue(), 2);
+ }
+ }
+ LOG.debug("In PceLink: The CD and PMD2 of link {} are respectively {} ps and {} ps",
+ link.getLinkId(), linkCd, linkPmd2);
+ return Map.of("CD", linkCd, "PMD2", linkPmd2);
+ }
+
+ // compute default spanLoss and power correction from fiber length
+ // when no OMS attribute defined
+ private Map<String, Double> calcDefaultSpanLoss(Link link) {
+ var augLinkLength = link.augmentation(Link1.class).getLinkLength();
+ if (augLinkLength == null || augLinkLength.doubleValue() == 0) {
+ LOG.error("In PceLink, no link length present or length declared = 0,"
+ + " unable to calculate default span Loss ");
+ return new HashMap<>();
+ }
+ long linkLength = augLinkLength.longValue();
+ LOG.warn("In PceLink {}, assume G.652 fiber, calculation "
+ + "based on fiber length of {} km and typical loss of 0.25dB per Km ",
+ link.getLinkId(), linkLength);
+ return new HashMap<>(
+ Map.of(
+ "SpanLoss", linkLength * 0.25,
+ "PoutCorrection", retrievePower(FiberType.Smf)
+ ));
+ }
+
+ // Compute the attenuation of a span from OMS attribute
+ private Map<String, Double> calcSpanLoss(Link link) {
+ if (this.omsAttributesSpan == null) {
+ return calcDefaultSpanLoss(link);
+ }
+ Collection<LinkConcatenation> linkConcatenationList =
+ this.omsAttributesSpan.nonnullLinkConcatenation().values();
+ if (linkConcatenationList == null) {