From: Ahmed Triki Date: Fri, 28 Jun 2019 07:54:37 +0000 (+0200) Subject: Minor changes in the topology extraction for GNPy X-Git-Tag: 0.4.0~50^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=commitdiff_plain;h=b0834a357c852430d3463337517b2d90b9adbfda Minor changes in the topology extraction for GNPy -Compute the loss coefficient based on the length of span and the span loss -Fixing the AttIn to zero as this metric is not supported by T-PCE JIRA: TRNSPRTPCE-87 Change-Id: If91fea8781c576083c306e5f115b31a0386c2ffb Signed-off-by: Ahmed Triki --- diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java index 81fdd525e..5c0d4031b 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java @@ -127,11 +127,12 @@ public class ExtractTopoDataStoreImpl { } else { elements = null; } - if (map.containsKey("Elements")) { + if (map.containsKey("Connections")) { connections = (List) map.get("Connections"); } else { connections = null; } + pathRequest = extractPathRequest(input, atoz, requestId); synchronization = extractSynchronization(requestId); } @@ -145,7 +146,7 @@ public class ExtractTopoDataStoreImpl { } else { elements = null; } - if (map.containsKey("Elements")) { + if (map.containsKey("Connections")) { connections = (List) map.get("Connections"); } else { connections = null; @@ -243,7 +244,7 @@ public class ExtractTopoDataStoreImpl { int idFiber = 0; int nbEDFA = 0; if (!linksList.isEmpty()) { - LOG.warn("The link list is not empty"); + LOG.debug("The link list is not empty"); for (Link link : linksList) { Link1 link1 = link.augmentation(Link1.class); int linkType = link1.getLinkType().getIntValue(); @@ -317,8 +318,7 @@ public class ExtractTopoDataStoreImpl { mapFiberIp.put(clfi, ipFiber); idFiber++; - double attIn = span.getSpanlossCurrent().getValue().doubleValue(); - double lossCoef = 0.2; + double attIn = 0; double connIn = 0; double connOut = 0; String typeVariety = "SSMF"; @@ -331,6 +331,7 @@ public class ExtractTopoDataStoreImpl { //convert to kilometer length += srlgLength / convertKmM; } + double lossCoef = span.getSpanlossCurrent().getValue().doubleValue() / length; Elements element1 = addElementsFiber(2, 0, "RLD", "Lannion_CAS", ipFiber.getIpv4Address().getValue(), length, attIn, lossCoef, connIn, @@ -577,7 +578,7 @@ public class ExtractTopoDataStoreImpl { public List extractSynchronization(Long requestId) { // Create RequestIdNumber List requestIdNumber = new ArrayList<>(); - requestIdNumber.add(0, new Long(0)); + requestIdNumber.add(requestId); // Create a synchronization Svec svec = new SvecBuilder().setRelaxable(true).setDisjointness(new TePathDisjointness(true, true, false)) .setRequestIdNumber(requestIdNumber).build();