2021-08-06 12:28:20 -04:00
|
|
|
"""
|
2021-08-17 12:52:48 -04:00
|
|
|
Traffic network module
|
2021-08-06 12:28:20 -04:00
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|
|
|
Code contributors: Guille guille.gutierrezmorote@concordia.ca
|
2021-08-06 12:28:20 -04:00
|
|
|
"""
|
|
|
|
|
2021-10-22 11:28:22 -04:00
|
|
|
from typing import List
|
2021-08-17 12:52:48 -04:00
|
|
|
from city_model_structure.network import Network
|
2021-10-22 11:28:22 -04:00
|
|
|
from city_model_structure.transport.traffic_edge import TrafficEdge
|
|
|
|
from city_model_structure.transport.traffic_node import TrafficNode
|
2021-08-06 12:28:20 -04:00
|
|
|
|
|
|
|
|
2021-08-17 12:52:48 -04:00
|
|
|
class TrafficNetwork(Network):
|
2021-08-06 12:28:20 -04:00
|
|
|
"""
|
2021-10-18 16:07:18 -04:00
|
|
|
TrafficNetwork(Network) class
|
2021-08-06 12:28:20 -04:00
|
|
|
"""
|
2021-08-17 12:52:48 -04:00
|
|
|
def __init__(self, name, edges=None, nodes=None):
|
2021-08-25 07:23:02 -04:00
|
|
|
super().__init__(name, edges, nodes)
|
2021-08-26 09:19:38 -04:00
|
|
|
self._type = "TrafficNetwork"
|
|
|
|
|
|
|
|
@property
|
|
|
|
def type(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get network type
|
|
|
|
:return: str
|
2021-08-26 09:19:38 -04:00
|
|
|
"""
|
|
|
|
return self._type
|
2021-10-22 11:28:22 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def edges(self) -> List[TrafficEdge]:
|
|
|
|
"""
|
|
|
|
Get network edges
|
|
|
|
:return: [TrafficEdge]
|
|
|
|
"""
|
|
|
|
return self._edges
|
|
|
|
|
|
|
|
@property
|
|
|
|
def nodes(self) -> List[TrafficNode]:
|
|
|
|
"""
|
|
|
|
Get network nodes
|
|
|
|
:return: [TrafficNode]
|
|
|
|
"""
|
|
|
|
return self._nodes
|