Add to_directory method to relevant object classes
[oam.git] / code / network-generator / network_generation / model / python / o_ran_network.py
index 907c20d..901e83f 100644 (file)
@@ -17,6 +17,7 @@
 Module for a class representing a O-RAN Network
 """
 import xml.etree.ElementTree as ET
+import os
 from typing import Any, cast
 
 import network_generation.model.python.hexagon as Hexagon
@@ -63,11 +64,11 @@ class ORanNetwork(ORanObject):
         )
 
         size: int = int(
-            int(configuration["pattern"]["nr-cell-du"]["maxReach"])
+            int(configuration["pattern"]["nrCellDu"]["maxReach"])
             / (
                 1
                 + int(
-                    configuration["pattern"]["nr-cell-du"][
+                    configuration["pattern"]["nrCellDu"][
                         "cellScaleFactorForHandoverArea"
                     ]
                 )
@@ -81,16 +82,16 @@ class ORanNetwork(ORanObject):
             {
                 "oRanSmoSpiralRadiusOfNearRtRics": configuration["pattern"][
                     "smo"
-                ]["near-rt-ric-spiral-radius"],
+                ]["nearRtRicSpiralRadius"],
                 "oRanNearRtRicSpiralRadiusOfOCus": configuration["pattern"][
-                    "near-rt-ric"
-                ]["o-ran-cu-spiral-radius"],
+                    "nearRtRic"
+                ]["oRanCuSpiralRadius"],
                 "oRanCuSpiralRadiusOfODus": configuration["pattern"][
-                    "o-ran-cu"
-                ]["o-ran-du-spiral-radius"],
+                    "oRanCu"
+                ]["oRanDuSpiralRadius"],
                 "oRanDuSpiralRadiusOfTowers": configuration["pattern"][
-                    "o-ran-du"
-                ]["tower-spiral-radius"],
+                    "oRanDu"
+                ]["towerSpiralRadius"],
             }
         )
         self._o_ran_smo = ORanSmo(
@@ -148,6 +149,9 @@ class ORanNetwork(ORanObject):
             }
         }
 
+    def to_directory(self, parent_dir: str) -> None:
+        self._o_ran_smo.to_directory(os.path.join(parent_dir, self.id))
+
     def toKml(self) -> ET.Element:
         root: ET.Element = ET.Element(
             "kml", xmlns="http://www.opengis.net/kml/2.2"