Create Resource pool for O-DUs
[oam.git] / code / network-generator / model / python / o_ran_cu.py
index 70e1e44..9069f36 100644 (file)
 
 """
 A Class representing an O-RAN centralized unit (ORanCu)
+and at the same time a location for an O-Cloud resource pool
 """
 from model.python.cube import Cube
 from model.python.hexagon import Hex
 import model.python.hexagon as Hexagon
-from model.python.o_ran_du import ORanDu
+from model.python.o_ran_cloud_du import ORanCloudDu
 from model.python.tower import Tower
 from model.python.o_ran_object import IORanObject
 from model.python.o_ran_node import ORanNode
@@ -37,23 +38,23 @@ class IORanCu(IORanObject):
 class ORanCu(ORanNode, IORanCu):
     def __init__(self, o_ran_cu_data: IORanCu = None, **kwargs):
         super().__init__(o_ran_cu_data, **kwargs)
-        self._o_ran_dus: list[ORanCu] = self._calculate_o_ran_dus()
+        self._o_ran_cloud_dus: list[ORanCu] = self._calculate_o_ran_dus()
 
-    def _calculate_o_ran_dus(self) -> list[ORanDu]:
+    def _calculate_o_ran_dus(self) -> list[ORanCloudDu]:
         hex_ring_radius: int = self.spiralRadiusProfile.oRanCuSpiralRadiusOfODus
         hex_list: list[Hex] = self.spiralRadiusProfile.oRanDuSpiral(self.position, hex_ring_radius)
-        result: list[ORanDu] = []
+        result: list[ORanCloudDu] = []
         for index, hex in enumerate(hex_list):
             s: str = "00" + str(index)
             name: str = "-".join(
-                [self.name.replace("CU", "DU"), s[len(s) - 2 : len(s)]]
+                [self.name.replace("CU", "O-Cloud-DU"), s[len(s) - 2 : len(s)]]
             )
             network_center: dict = self.parent.parent.parent.center
             newGeo = Hexagon.hex_to_geo_location(
                 self.layout, hex, network_center
             ).json()
             result.append(
-                ORanDu(
+                ORanCloudDu(
                     {
                         "name": name,
                         "geoLocation": newGeo,
@@ -68,13 +69,13 @@ class ORanCu(ORanNode, IORanCu):
 
 
     @property
-    def o_ran_dus(self) -> list[ORanDu]:
-        return self._o_ran_dus
+    def o_ran_cloud_dus(self) -> list[ORanCloudDu]:
+        return self._o_ran_cloud_dus
 
     @property
     def towers(self) -> list[Tower]:
         result: list[Tower] = []
-        for du in self.o_ran_dus:
+        for du in self.o_ran_cloud_dus:
             for tower in du.towers:
                 result.append(tower)
         return result
@@ -85,7 +86,7 @@ class ORanCu(ORanNode, IORanCu):
         open.text = "1"
         name: ET.Element = ET.SubElement(o_ran_cu, "name")
         name.text = self.name
-        for o_ran_du in self.o_ran_dus:
+        for o_ran_du in self.o_ran_cloud_dus:
             o_ran_cu.append(o_ran_du.toKml())
         return o_ran_cu