123 lines
2.2 KiB
Python
123 lines
2.2 KiB
Python
|
"""
|
||
|
Split 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
|
||
|
"""
|
||
|
|
||
|
from typing import List, TypeVar
|
||
|
|
||
|
Lane = TypeVar['Lane']
|
||
|
Edge = TypeVar['Edge']
|
||
|
|
||
|
|
||
|
class Split:
|
||
|
"""
|
||
|
Split class
|
||
|
"""
|
||
|
|
||
|
def __init__(self):
|
||
|
self._position = None
|
||
|
self._lanes = None
|
||
|
self._speed = None
|
||
|
self._id = None
|
||
|
self._edge_before = None
|
||
|
self._edge_after = None
|
||
|
|
||
|
@property
|
||
|
def position(self):
|
||
|
"""
|
||
|
The position along the edge at which the split shall be done (in m);
|
||
|
if a negative position is given, the split is inserted counting from the end of the edge
|
||
|
:return: float
|
||
|
"""
|
||
|
return self._position
|
||
|
|
||
|
@position.setter
|
||
|
def position(self, value):
|
||
|
"""
|
||
|
Position setter
|
||
|
:param value: float
|
||
|
"""
|
||
|
self._position = value
|
||
|
|
||
|
@property
|
||
|
def lanes(self) -> List[Lane]:
|
||
|
"""
|
||
|
List of lanes after the split
|
||
|
:return: List[Lane]
|
||
|
"""
|
||
|
return self._lanes
|
||
|
|
||
|
@lanes.setter
|
||
|
def lanes(self, value):
|
||
|
"""
|
||
|
List of lanes setter
|
||
|
:param value: List[Lane]
|
||
|
"""
|
||
|
self._lanes = value
|
||
|
|
||
|
@property
|
||
|
def speed(self):
|
||
|
"""
|
||
|
Speed limit after the split in m/s
|
||
|
:return: float
|
||
|
"""
|
||
|
return self._speed
|
||
|
|
||
|
@speed.setter
|
||
|
def speed(self, value):
|
||
|
"""
|
||
|
Speed limit in m/s setter
|
||
|
:param value: float
|
||
|
"""
|
||
|
self._speed = value
|
||
|
|
||
|
@property
|
||
|
def id(self):
|
||
|
"""
|
||
|
Type id
|
||
|
:return: str
|
||
|
"""
|
||
|
return self._id
|
||
|
|
||
|
@id.setter
|
||
|
def id(self, value):
|
||
|
"""
|
||
|
Type id setter
|
||
|
:param value: str
|
||
|
"""
|
||
|
self._id = value
|
||
|
|
||
|
@property
|
||
|
def edge_before(self) -> Edge:
|
||
|
"""
|
||
|
Edge before the split
|
||
|
:return: Edge
|
||
|
"""
|
||
|
return self._edge_before
|
||
|
|
||
|
@edge_before.setter
|
||
|
def edge_before(self, value):
|
||
|
"""
|
||
|
edge_before setter
|
||
|
:param value: Edge
|
||
|
"""
|
||
|
self._edge_before = value
|
||
|
|
||
|
@property
|
||
|
def edge_after(self) -> Edge:
|
||
|
"""
|
||
|
Edge after the split
|
||
|
:return: Edge
|
||
|
"""
|
||
|
return self._edge_after
|
||
|
|
||
|
@edge_after.setter
|
||
|
def edge_after(self, value):
|
||
|
"""
|
||
|
edge_after setter
|
||
|
:param value: Edge
|
||
|
"""
|
||
|
self._edge_after = value
|