Mount O-RAN RUs at Towers 85/11985/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 27 Oct 2023 19:39:49 +0000 (21:39 +0200)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 27 Oct 2023 19:39:56 +0000 (21:39 +0200)
- association between O-DU and Tower removed
- preparation for association from O-RU to Cell
- association between Tower and O-RUs added

Issue-ID: OAM-377
Change-Id: Iaeeab854d429b8f8402ca0ca009b3d2f387d3bc9
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/model/python/o_ran_du.py
code/network-generator/model/python/o_ran_ru.py
code/network-generator/model/python/tower.py

index 19eb3d0..081a738 100644 (file)
@@ -20,7 +20,7 @@ A Class representing an O-RAN distributed unit (ORanDu)
 import model.python.hexagon as Hexagon
 from model.python.hexagon import Hex
 from model.python.cube import Cube
-from model.python.tower import Tower
+from model.python.o_ran_ru import ORanRu
 from model.python.o_ran_object import IORanObject
 from model.python.o_ran_node import ORanNode
 import xml.etree.ElementTree as ET
@@ -28,31 +28,30 @@ import xml.etree.ElementTree as ET
 
 # Define the "IORanDu" interface
 class IORanDu(IORanObject):
-    def __init__(self, **kwargs):
+    def __init__(self, o_ran_ru_count: int, **kwargs):
         super().__init__(**kwargs)
+        self._o_ran_ru_count = o_ran_ru_count
 
 
 # Define an abstract O-RAN Node class
 class ORanDu(ORanNode, IORanDu):
     def __init__(self, o_ran_du_data: IORanDu = None, **kwargs):
         super().__init__(o_ran_du_data, **kwargs)
-        self._towers: list[Tower] = self._calculate_towers()
+        self._o_ran_rus: list[ORanRu] = self._calculate_o_ran_rus()
 
-    def _calculate_towers(self) -> list[Tower]:
-        hex_ring_radius: int = self.spiralRadiusProfile.oRanDuSpiralRadiusOfTowers
-        hex_list: list[Hex] = Cube.spiral(self.position, hex_ring_radius)
-        result: list[Tower] = []
-        for index, hex in enumerate(hex_list):
+    def _calculate_o_ran_rus(self) -> list[ORanRu]:
+        result: list[ORanRu] = []
+        for index in range(self._o_ran_ru_count):
             s: str = "00" + str(index)
             name: str = "-".join(
-                [self.name.replace("DU", "Tower"), s[len(s) - 2 : len(s)]]
+                [self.name.replace("DU", "RU"), s[len(s) - 2 : len(s)]]
             )
             network_center: dict = self.parent.parent.parent.parent.center
             newGeo = Hexagon.hex_to_geo_location(
                 self.layout, hex, network_center
             ).json()
             result.append(
-                Tower(
+                ORanRu(
                     {
                         "name": name,
                         "geoLocation": newGeo,
@@ -66,8 +65,8 @@ class ORanDu(ORanNode, IORanDu):
         return result
 
     @property
-    def towers(self) -> list[Tower]:
-        return self._towers
+    def o_ran_rus(self) -> list[ORanRu]:
+        return self._o_ran_rus
 
     def toKml(self) -> ET.Element:
         o_ran_du: ET.Element = ET.Element("Folder")
index 285156f..0ce0b90 100644 (file)
@@ -24,14 +24,16 @@ import xml.etree.ElementTree as ET
 
 # Define the "IORanRu" interface
 class IORanRu(IORanObject):
-    def __init__(self, **kwargs):
+    def __init__(self, cell_count: int, **kwargs):
         super().__init__(**kwargs)
+        self._cell_count = cell_count
 
 
 # Define an abstract O-RAN Node class
 class ORanRu(ORanNode, IORanRu):
-    def __init__(self, o_ran_smo_data: IORanRu = None, **kwargs):
-        super().__init__(o_ran_smo_data, **kwargs)
+    def __init__(self, o_ran_ru_data: IORanRu = None, **kwargs):
+        super().__init__(o_ran_ru_data, **kwargs)
+        self._cell_count = o_ran_ru_data["cellCount"] if o_ran_ru_data and "cellCount" in o_ran_ru_data else 1
 
     def toKml(self) -> None:
         return None
index a28909d..ebc118f 100644 (file)
 #!/usr/bin/python
 
 """
-A Class representing a Tower to mount O-RAN RUx
+A Class representing a Tower to mount O-RAN RUs
+It can be interpreted as 'resource pool' for physical network
+functions.
 """
+from model.python.o_ran_object import IORanObject
+from model.python.o_ran_ru import IORanRu, ORanRu
 import model.python.hexagon as Hexagon
 from model.python.point import Point
 from model.python.geo_location import GeoLocation
 from model.python.o_ran_node import ORanNode
 import xml.etree.ElementTree as ET
 
+# Define the "IORanDu" interface
+class ITower(IORanObject):
+    def __init__(self, o_ran_ru_count: int, **kwargs):
+        super().__init__(**kwargs)
+        self._o_ran_ru_count = o_ran_ru_count
 
-# Define an abstract O-RAN Node class
+# Implement a concrete O-RAN Node class
 class Tower(ORanNode):
-    # def __init__(self, **kwargs):
-    #     super().__init__(**kwargs)
+
+    def __init__(self, tower_data: ITower = None, **kwargs):
+        super().__init__(tower_data, **kwargs)
+        self._o_ran_ru_count = tower_data["oRanRuCount"] if tower_data and "oRanRuCount" in tower_data else 3
+        self._o_ran_rus: list[ORanRu] = self._create_o_ran_rus()
+
+    def _create_o_ran_rus(self) -> list [ORanRu]:
+        result : list [ORanRu] = []
+        for index in range(self._o_ran_ru_count):
+            s: str = "00" + str(index)
+            name: str = "-".join(
+                [self.name.replace("Tower", "RU"), s[len(s) - 2 : len(s)]]
+            )
+            cell_count: int = self.parent.parent.parent.parent.parent.configuration()['pattern']["o-ran-ru"]["nr-cell-du-count"]
+            result.append(
+                ORanRu(
+                    {
+                        "name": name,
+                        "geoLocation": self.geoLocation,
+                        "position": self.position,
+                        "layout": self.layout,
+                        "spiralRadiusProfile": self.spiralRadiusProfile,
+                        "parent": self,
+                        "cellCount": cell_count
+                    }
+                )
+            )
+        return result
 
     def toKml(self) -> ET.Element:
         placemark: ET.Element = ET.Element("Placemark")