hub/city_model_structure/transport/join.py

28 lines
842 B
Python
Raw Normal View History

"""
Join module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca
2021-08-17 12:52:48 -04:00
Contributor Guille guille.gutierrezmorote@concordia.ca
"""
2021-08-17 12:52:48 -04:00
from city_model_structure.transport.traffic_node import TrafficNode
2021-08-17 12:52:48 -04:00
class Join(TrafficNode):
"""
Join class
"""
2021-08-17 13:30:51 -04:00
def __init__(self, name, coordinates, nodes):
2021-08-17 12:52:48 -04:00
self._nodes = nodes
2021-08-17 13:30:51 -04:00
edges = []
prohibitions = []
connections = []
for node in self._nodes:
edges = edges + node.edges
prohibitions = prohibitions + node.prohibitions
connections = connections + node.connections
super().__init__(name, coordinates, edges=edges, prohibitions=prohibitions, connections=connections,
node_type='Join')