city_retrofit/city_model_structure/transport/lane.py

138 lines
2.8 KiB
Python

"""
Lane 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
class Lane:
"""
Lane class
"""
def __init__(self):
self._index = None
self._allow = None
self._disallow = None
self._change_left = None
self._change_right = None
self._speed = None
self._width = None
@property
def index(self):
"""
Get lane index
The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)
:return: int
"""
return self._index
@index.setter
def index(self, value):
"""
Set lane index
The enumeration index of the lane (0 is the rightmost lane, <NUMBER_LANES>-1 is the leftmost one)
:param value: int
"""
self._index = value
@property
def allow(self) -> List[str]:
"""
Get the list of allowed vehicle classes
:return: [str]
"""
return self._allow
@allow.setter
def allow(self, value):
"""
Set the list of allowed vehicle classes setter
:param value: [str]
"""
self._allow = value
@property
def disallow(self) -> List[str]:
"""
Get the list of not allowed vehicle classes
:return: [str]
"""
return self._disallow
@disallow.setter
def disallow(self, value):
"""
Get the list of not allowed vehicle classes setter
:param value: [str]
"""
self._disallow = value
@property
def change_left(self) -> List[str]:
"""
Get the list of vehicle classes that may change left from this lane
:return: [str]
"""
return self._change_left
@change_left.setter
def change_left(self, value):
"""
Set the list of vehicle classes that may change left from this lane
:param value: [str]
"""
self._change_left = value
@property
def change_right(self) -> List[str]:
"""
Get the list of vehicle classes that may change right from this lane
:return: [str]
"""
return self._change_right
@change_right.setter
def change_right(self, value):
"""
Set the list of vehicle classes that may change right from this lane
:param value: [str]
"""
self._change_right = value
@property
def speed(self):
"""
Get the lane speed in m/s
:return: float
"""
return self._speed
@speed.setter
def speed(self, value):
"""
Set the lane speed in m/s
:param value: float
"""
self._speed = value
@property
def width(self):
"""
Get the lane width in meters
:return: float
"""
return self._width
@width.setter
def width(self, value):
"""
Set the lane width in meters
:param value: float
"""
self._width = value