added many new classes needed for the transportation group models. The documentation is not done because it is needed the students feed-back

This commit is contained in:
Pilar 2021-10-22 13:13:12 -04:00 committed by guille
parent 41f79b189a
commit 0a75cf46e6
27 changed files with 452 additions and 19 deletions

View File

@ -1,7 +1,7 @@
""" """
Node module Node module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
""" """
import uuid import uuid

View File

@ -1,12 +1,13 @@
""" """
Node module Node module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
""" """
import uuid import uuid
from typing import List, TypeVar from typing import List, TypeVar
from city_model_structure.attributes.time_series import TimeSeries
Edge = TypeVar('Edge') Edge = TypeVar('Edge')
@ -21,6 +22,7 @@ class Node:
self._name = name self._name = name
self._id = None self._id = None
self._edges = edges self._edges = edges
self._time_series = None
@property @property
def name(self): def name(self):
@ -47,3 +49,7 @@ class Node:
:return: [Edge] :return: [Edge]
""" """
return self._edges return self._edges
@property
def time_series(self) -> TimeSeries:
return self._time_series

View File

@ -0,0 +1,28 @@
"""
Record module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
class Record:
"""
Record class
"""
def __init__(self, time=None, value=None, flag=None):
self._time = time
self._value = value
self._flag = flag
@property
def time(self):
return self._time
@property
def value(self):
return self._value
@property
def flag(self):
return self._flag

View File

@ -0,0 +1,26 @@
"""
Time series module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import List
from city_model_structure.attributes.record import Record
class TimeSeries:
"""
TimeSeries class
"""
def __init__(self, time_series_type=None, records=None):
self._time_series_type = time_series_type
self._records = records
@property
def time_series_type(self):
return self._time_series_type
@property
def records(self) -> List[Record]:
return self._records

View File

@ -0,0 +1,40 @@
"""
Bus system module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import List
from city_model_structure.city_object import CityObject
from city_model_structure.attributes.polygon import Polygon
from city_model_structure.transport.bus_network import BusNetwork
from city_model_structure.transport.bus_node import BusNode
from city_model_structure.transport.bus import Bus
class BusSystem(CityObject):
"""
BusSystem(CityObject) class
"""
def __init__(self, name, lod, surfaces, city_lower_corner):
super().__init__(name, lod, surfaces, city_lower_corner)
self._bus_routes = None
self._bus_network = None
self._buses = None
self._restricted_polygons = None
@property
def bus_routes(self) -> List[BusNode]:
return self._bus_routes
@property
def bus_network(self) -> BusNetwork:
return self._bus_network
@property
def buses(self) -> List[Bus]:
return self._buses
@property
def restricted_polygons(self) -> List[Polygon]:
return self._restricted_polygons

View File

@ -1,7 +1,7 @@
""" """
EnergySystem module EnergySystem module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from city_model_structure.city_object import CityObject from city_model_structure.city_object import CityObject

View File

@ -1,9 +1,10 @@
""" """
Network module Network module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
""" """
import uuid import uuid
from typing import List from typing import List

View File

@ -0,0 +1,70 @@
"""
Bus module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from city_model_structure.attributes.schedule import Schedule
class Bus:
"""
Bus class
"""
def __init__(self):
self._maintenance_time = None
self._charging_time = None
self._recovery_time = None
self._vehicle_type = None
self._energy_consumption = None
self._trips_schedule = None
self._capacity = None
self._maintenance_cost = None
self._investment_cost = None
self._charging_range = None
self._maximum_travel_range = None
@property
def maintenance_time(self):
return self._maintenance_time
@property
def charging_time(self):
return self._charging_time
@property
def recovery_time(self):
return self.maintenance_time + self.charging_time
@property
def vehicle_type(self):
return self._vehicle_type
@property
def energy_consumption(self):
return self._energy_consumption
@property
def trips_schedule(self) -> Schedule:
return self._trips_schedule
@property
def capacity(self):
return self._capacity
@property
def maintenance_cost(self):
return self._maintenance_cost
@property
def investment_cost(self):
return self._investment_cost
@property
def charging_range(self):
return self._charging_range
@property
def maximum_travel_range(self):
return self._maximum_travel_range

View File

@ -0,0 +1,26 @@
"""
Bus depot module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from city_model_structure.transport.bus_node import BusNode
class BusDepot(BusNode):
"""
BusDepot class
"""
def __init__(self, name, coordinates, edges=None):
super().__init__(name, coordinates, edges=edges, node_type='BusDepot')
self._number_of_charging_poles = None
self._number_of_available_buses = None
@property
def number_of_charging_poles(self):
return self._number_of_charging_poles
@property
def number_of_available_buses(self):
return self._number_of_available_buses

View File

@ -0,0 +1,41 @@
"""
Bus edge module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import List
from city_model_structure.attributes.edge import Edge
from city_model_structure.transport.bus_node import BusNode
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):
return self._average_travel_time

View File

@ -0,0 +1,43 @@
"""
Bus network module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import List
from city_model_structure.network import Network
from city_model_structure.transport.bus_edge import BusEdge
from city_model_structure.transport.bus_node import BusNode
class BusNetwork(Network):
"""
BusNetwork(Network) class
"""
def __init__(self, name, edges=None, nodes=None):
super().__init__(name, edges, nodes)
self._type = "BusNetwork"
@property
def type(self):
"""
Get network type
:return: str
"""
return self._type
@property
def edges(self) -> List[BusEdge]:
"""
Get network edges
:return: [BusEdge]
"""
return self._edges
@property
def nodes(self) -> List[BusNode]:
"""
Get network nodes
:return: [BusNode]
"""
return self._nodes

View File

@ -0,0 +1,54 @@
"""
Bus node module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import List
from city_model_structure.attributes.node import Node
from city_model_structure.attributes.point import Point
from city_model_structure.transport.bus_edge import BusEdge
class BusNode(Node):
"""
BusNode class
"""
def __init__(self, name, coordinates, node_type='BusNode', edges=None):
super().__init__(name, edges)
self._coordinates = coordinates
self._node_type = node_type
@property
def node_type(self):
"""
Get node type
:return: str
"""
return self._node_type
@property
def coordinates(self) -> Point:
"""
Get node coordinates
:return: Point
"""
return self._coordinates
@coordinates.setter
def coordinates(self, value):
"""
Set node coordinates
:param value: Point
"""
self._coordinates = value
@property
def edges(self) -> List[BusEdge]:
"""
get edges delimited by the node
:return: [BusEdge]
"""
return self._edges

View File

@ -0,0 +1,39 @@
"""
Bus stop module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union
from city_model_structure.transport.bus_node import BusNode
from city_model_structure.transport.fast_charging_infrastructure import FastChargingInfrastructure
from city_model_structure.attributes.schedule import Schedule
class BusStop(BusNode):
"""
BusStop class
"""
def __init__(self, name, coordinates, edges=None):
super().__init__(name, coordinates, edges=edges, node_type='BusStop')
self._time_table = None
self._average_hourly_passengers_demand = None
self._fast_charging_infrastructure = None
self._waiting_time = None
@property
def time_table(self):
return self._time_table
@property
def average_hourly_passengers_demand(self) -> Schedule:
return self._average_hourly_passengers_demand
@property
def fast_charging_infrastructure(self) -> Union[None, FastChargingInfrastructure]:
return self._fast_charging_infrastructure
@property
def waiting_time(self):
return self._waiting_time

View File

@ -1,7 +1,7 @@
""" """
Connection module Connection module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """

View File

@ -1,7 +1,7 @@
""" """
Crossing module Crossing module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """

View File

@ -0,0 +1,23 @@
"""
Fast charging infrastructure module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
class FastChargingInfrastructure:
"""
FastChargingInfrastructure class
"""
def __init__(self):
self._electrical_demand = None
self._losses_in_grid = None
@property
def electrical_demand(self):
return self._electrical_demand
@property
def losses_in_grid(self):
return self._losses_in_grid

View File

@ -1,7 +1,7 @@
""" """
Join module Join module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """

View File

@ -1,7 +1,7 @@
""" """
Lane module Lane module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
""" """

View File

@ -1,11 +1,13 @@
""" """
Origin-Destination edge module Origin-Destination edge module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from typing import List
from city_model_structure.attributes.edge import Edge from city_model_structure.attributes.edge import Edge
from city_model_structure.transport.origin_destination_node import OriginDestinationNode
from city_model_structure.attributes.schedule import Schedule from city_model_structure.attributes.schedule import Schedule
@ -28,6 +30,14 @@ class OriginDestinationEdge(Edge):
""" """
return self._edge_type return self._edge_type
@property
def nodes(self) -> List[OriginDestinationNode]:
"""
Get delimiting nodes for the edge
:return: [OriginDestinationNode]
"""
return self._nodes
@property @property
def movement_schedule(self) -> Schedule: def movement_schedule(self) -> Schedule:
""" """

View File

@ -1,7 +1,7 @@
""" """
Origin-Destination network module Origin-Destination network module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from typing import List from typing import List

View File

@ -1,7 +1,7 @@
""" """
Origin-Destination node module Origin-Destination node module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from typing import List from typing import List
@ -9,6 +9,7 @@ from city_model_structure.attributes.node import Node
from city_model_structure.attributes.point import Point from city_model_structure.attributes.point import Point
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
from city_model_structure.city_object import CityObject from city_model_structure.city_object import CityObject
from city_model_structure.transport.origin_destination_edge import OriginDestinationEdge
class OriginDestinationNode(Node): class OriginDestinationNode(Node):
@ -48,6 +49,14 @@ class OriginDestinationNode(Node):
""" """
self._coordinates = value self._coordinates = value
@property
def edges(self) -> List[OriginDestinationEdge]:
"""
get edges delimited by the node
:return: [OriginDestinationEdge]
"""
return self._edges
@property @property
def polygon(self) -> Polygon: def polygon(self) -> Polygon:
""" """

View File

@ -1,7 +1,7 @@
""" """
Phase module Phase module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
""" """

View File

@ -1,13 +1,14 @@
""" """
Traffic edge module Traffic edge module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """
from typing import List, Union from typing import List, Union
from city_model_structure.attributes.edge import Edge from city_model_structure.attributes.edge import Edge
from city_model_structure.transport.traffic_node import TrafficNode
from city_model_structure.transport.lane import Lane from city_model_structure.transport.lane import Lane
@ -37,6 +38,14 @@ class TrafficEdge(Edge):
""" """
return self._edge_type return self._edge_type
@property
def nodes(self) -> List[TrafficNode]:
"""
Get delimiting nodes for the edge
:return: [TrafficNode]
"""
return self._nodes
@property @property
def lanes(self) -> List[Lane]: def lanes(self) -> List[Lane]:
""" """

View File

@ -1,7 +1,7 @@
""" """
Traffic light module Traffic light module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """

View File

@ -1,7 +1,7 @@
""" """
Traffic network module Traffic network module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """

View File

@ -1,17 +1,17 @@
""" """
TrafficNode module TrafficNode module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """
from typing import List from typing import List
from city_model_structure.attributes.edge import Edge from city_model_structure.attributes.edge import Edge
from city_model_structure.attributes.node import Node from city_model_structure.attributes.node import Node
from city_model_structure.attributes.point import Point from city_model_structure.attributes.point import Point
from city_model_structure.transport.traffic_edge import TrafficEdge
from city_model_structure.transport.connection import Connection from city_model_structure.transport.connection import Connection
@ -55,6 +55,14 @@ class TrafficNode(Node):
""" """
self._coordinates = value self._coordinates = value
@property
def edges(self) -> List[TrafficEdge]:
"""
get edges delimited by the node
:return: [TrafficEdge]
"""
return self._edges
@property @property
def prohibitions(self) -> [(Edge, Edge)]: def prohibitions(self) -> [(Edge, Edge)]:
""" """

View File

@ -1,7 +1,7 @@
""" """
Walkway node module Walkway node module
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Contributor Milad milad.aghamohamadnia@concordia.ca Contributor Milad milad.aghamohamadnia@concordia.ca
Contributor Guille guille.gutierrezmorote@concordia.ca Contributor Guille guille.gutierrezmorote@concordia.ca
""" """