2021-10-22 13:13:12 -04:00
|
|
|
"""
|
|
|
|
Bus edge module
|
|
|
|
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
|
2021-10-22 13:13:12 -04:00
|
|
|
"""
|
|
|
|
|
2021-10-25 13:28:43 -04:00
|
|
|
from typing import List, TypeVar
|
2021-10-22 13:13:12 -04:00
|
|
|
from city_model_structure.attributes.edge import Edge
|
2021-10-25 13:28:43 -04:00
|
|
|
|
|
|
|
BusNode = TypeVar('BusNode')
|
2021-10-22 13:13:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
class BusEdge(Edge):
|
|
|
|
"""
|
|
|
|
BusEdge class
|
|
|
|
Each edge is unidirectional and starts at the "from" node and ends at the "to" node
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, name, nodes, edge_type='BusEdge'):
|
|
|
|
super().__init__(name, nodes)
|
|
|
|
self._edge_type = edge_type
|
|
|
|
self._average_travel_time = None
|
|
|
|
|
|
|
|
@property
|
|
|
|
def edge_type(self):
|
|
|
|
"""
|
|
|
|
Get the edge type
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
return self._edge_type
|
|
|
|
|
|
|
|
@property
|
|
|
|
def nodes(self) -> List[BusNode]:
|
|
|
|
"""
|
|
|
|
Get delimiting nodes for the edge
|
|
|
|
:return: [BusNode]
|
|
|
|
"""
|
|
|
|
return self._nodes
|
|
|
|
|
|
|
|
@property
|
|
|
|
def average_travel_time(self):
|
2021-10-25 13:33:08 -04:00
|
|
|
"""
|
|
|
|
Add explanation here
|
|
|
|
:return: add type of variable here
|
|
|
|
"""
|
2021-10-22 13:13:12 -04:00
|
|
|
return self._average_travel_time
|