Minor changes in the topology extraction for GNPy 68/82768/3
authorAhmed Triki <ahmed.triki@orange.com>
Fri, 28 Jun 2019 07:54:37 +0000 (09:54 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Fri, 28 Jun 2019 12:32:50 +0000 (14:32 +0200)
-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 <ahmed.triki@orange.com>
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/ExtractTopoDataStoreImpl.java

index 81fdd525e247974f34c527beb35a725d477aae20..5c0d4031bff25cbe78d16132e97c9f306023b634 100644 (file)
@@ -127,11 +127,12 @@ public class ExtractTopoDataStoreImpl {
         } else {
             elements = null;
         }
-        if (map.containsKey("Elements")) {
+        if (map.containsKey("Connections")) {
             connections = (List<Connections>) 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<Connections>) 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<Synchronization> extractSynchronization(Long requestId) {
         // Create RequestIdNumber
         List<Long> 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();