--- /dev/null
+# Copyright 2023 highstreet technologies GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# inspired by https://github.com/rochacbruno/python-project-template
+
+"""
+network_generation base module.
+
+This is the principal module of the network_generation project.
+"""
+
+# example constant variable
+NAME = "network_generation"
Module containing the Generator class.
"""
-from model.python.o_ran_network import ORanNetwork
+from network_generation.model.python.o_ran_network import ORanNetwork
class NetworkGenerator:
# inspired by http://www.redblobgames.com/grids/hexagons/
#!/usr/bin/python
-from model.python.hexagon import Hex
+from network_generation.model.python.hexagon import Hex
class Cube:
A collection of TypeDefinitions for a geographical location
"""
import math
-from model.python.point import Point
+from network_generation.model.python.point import Point
class IGeoLocationData:
import math
from typing import NamedTuple
-from model.python.point import Point
-from model.python.geo_location import GeoLocation
+from network_generation.model.python.point import Point
+from network_generation.model.python.geo_location import GeoLocation
class Hex:
"""
from typing import overload
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-import model.python.hexagon as Hexagon
-from model.python.point import Point
-from model.python.geo_location import GeoLocation
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.point import Point
+from network_generation.model.python.geo_location import GeoLocation
import xml.etree.ElementTree as ET
that the O-Cloud mechanism and concepts can be applied here.
"""
from typing import overload
-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_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Hex
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
import xml.etree.ElementTree as ET
and at the same time a location for an O-Cloud resource pool
"""
from typing import overload
-from model.python.cube import Cube
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
-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
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.o_ran_cloud_du import ORanCloudDu
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
import xml.etree.ElementTree as ET
A Class representing an O-RAN distributed unit (ORanDu)
"""
from typing import overload
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
import xml.etree.ElementTree as ET
A Class representing an O-RAN Near real-time intelligent controller (ORanNearRtRic)
"""
from typing import overload
-from model.python.tower import Tower
-from model.python.o_ran_cu import ORanCu
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_cu import ORanCu
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
import xml.etree.ElementTree as ET
"""
Module for a class representing a O-RAN Network
"""
-from model.python.o_ran_smo import ORanSmo
-from model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
-from model.python.o_ran_object import IORanObject, ORanObject
-import model.python.hexagon as Hexagon
-from model.python.hexagon import Layout
-from model.python.point import Point
+from network_generation.model.python.o_ran_smo import ORanSmo
+from network_generation.model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Layout
+from network_generation.model.python.point import Point
import xml.etree.ElementTree as ET
from typing import Any
import xml.etree.ElementTree as ET
import json
-from model.python.geo_location import GeoLocation
-from model.python.o_ran_object import IORanObject, ORanObject
-import model.python.hexagon as Hexagon
-from model.python.hexagon import Hex, Layout
-from model.python.point import Point
-from model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.type_definitions import (
+from network_generation.model.python.geo_location import GeoLocation
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
+import network_generation.model.python.hexagon as Hexagon
+from network_generation.model.python.hexagon import Hex, Layout
+from network_generation.model.python.point import Point
+from network_generation.model.python.o_ran_spiral_radius_profile import SpiralRadiusProfile
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.type_definitions import (
AddressType,
)
"""
An abstract Class for O-RAN Objects
"""
-from model.python.top import ITop, Top
+from network_generation.model.python.top import ITop, Top
# Define the "IORanObject" interface
"""
from typing import overload
-from model.python.o_ran_du import ORanDu
-from model.python.o_ran_termination_point import ORanTerminationPoint
-from model.python.nr_cell_du import NrCellDu
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_du import ORanDu
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.nr_cell_du import NrCellDu
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
import xml.etree.ElementTree as ET
A Class representing an O-RAN Service Management and Orchestration Framework (SMO)
"""
from typing import overload
-from model.python.tower import Tower
-from model.python.o_ran_near_rt_ric import ORanNearRtRic
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_node import ORanNode
-from model.python.hexagon import Hex
-from model.python.o_ran_termination_point import ORanTerminationPoint
-import model.python.hexagon as Hexagon
+from network_generation.model.python.tower import Tower
+from network_generation.model.python.o_ran_near_rt_ric import ORanNearRtRic
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.hexagon import Hex
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
+import network_generation.model.python.hexagon as Hexagon
import xml.etree.ElementTree as ET
#!/usr/bin/python
-from model.python.cube import Cube
-from model.python.hexagon import Hex
-import model.python.hexagon as Hexagon
+from network_generation.model.python.cube import Cube
+from network_generation.model.python.hexagon import Hex
+import network_generation.model.python.hexagon as Hexagon
class SpiralRadiusProfile:
An abstract Class for O-RAN TerminationPoint
"""
from abc import abstractmethod
-from model.python.o_ran_object import IORanObject, ORanObject
+from network_generation.model.python.o_ran_object import IORanObject, ORanObject
# Define the "IORanObject" interface
"""
import uuid
from abc import ABC
-from model.python.type_definitions import (
+from network_generation.model.python.type_definitions import (
AdministrativeState,
OperationalState,
UsageState,
functions.
"""
from typing import overload
-from model.python.o_ran_object import IORanObject
-from model.python.o_ran_ru import ORanRu
-from model.python.o_ran_node import ORanNode
-from model.python.o_ran_termination_point import ORanTerminationPoint
+from network_generation.model.python.o_ran_object import IORanObject
+from network_generation.model.python.o_ran_ru import ORanRu
+from network_generation.model.python.o_ran_node import ORanNode
+from network_generation.model.python.o_ran_termination_point import ORanTerminationPoint
import xml.etree.ElementTree as ET
A collection of TypeDefinitions
"""
from enum import Enum
-from model.python.countries import Country
+from network_generation.model.python.countries import Country
# Define AdministrativeState enum
"""
import json
-from model.python.o_ran_network import ORanNetwork
+from network_generation.model.python.o_ran_network import ORanNetwork
import xml.etree.ElementTree as ET
Method reading the css styles from known file
return: content of the file as string
"""
- with open("view/svg.style.css") as styles:
+ with open("network_generation/view/svg.style.css") as styles:
content = styles.read()
return content
:type filename: string
"""
root = self.__network.toKml()
- with open("view/kml.styles.json") as kml_styles:
+ with open("network_generation/view/kml.styles.json") as kml_styles:
styles: dict[str, dict] = json.load(kml_styles)
for key, value in styles.items():
# add style