1 # Copyright 2023 highstreet technologies GmbH
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 A Class representing an O-RAN Near real-time intelligent controller (ORanNearRtRic)
20 from model.python.tower import Tower
21 from model.python.o_ran_cu import ORanCu
22 from model.python.o_ran_object import IORanObject
23 from model.python.o_ran_node import ORanNode
24 import xml.etree.ElementTree as ET
27 # Define the "IORanNearRtRic" interface
28 class IORanNearRtRic(IORanObject):
29 def __init__(self, **kwargs):
30 super().__init__(**kwargs)
33 # Define an abstract O-RAN Node class
34 class ORanNearRtRic(ORanNode, IORanNearRtRic):
35 def __init__(self, o_ran_near_rt_ric_data: IORanNearRtRic = None, **kwargs):
36 super().__init__(o_ran_near_rt_ric_data, **kwargs)
37 self._o_ran_cus: list(ORanCu) = self._calculate_o_ran_cus()
39 def _calculate_o_ran_cus(self):
40 hex_ring_radius: int = self.spiralRadiusProfile.oRanNearRtRicSpiralRadiusOfOCus
42 s: str = "00" + str(index)
43 name: str = "O-RAN-CU-" + s[len(s) - 2 : len(s)]
44 result: list(ORanCu) = []
49 "geoLocation": self.geoLocation,
50 "position": self.position,
51 "layout": self.layout,
52 "spiralRadiusProfile": self.spiralRadiusProfile,
61 return self._o_ran_cus
65 result: list(Tower) = []
66 for cu in self.o_ran_cus:
67 for tower in cu.towers: