Added first version of traffic classes.

Reorganized classes inside "attributes" into different folders by topic.
This commit is contained in:
Pilar 2021-08-06 12:28:20 -04:00
parent 533e117b03
commit 2d71136d33
43 changed files with 1495 additions and 32 deletions

View File

@ -10,10 +10,10 @@ import sys
from typing import List from typing import List
import numpy as np import numpy as np
import math import math
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.thermal_zone import ThermalZone from city_model_structure.building_demand.thermal_zone import ThermalZone
from city_model_structure.attributes.usage_zone import UsageZone from city_model_structure.building_demand.usage_zone import UsageZone
from city_model_structure.attributes.storey import Storey from city_model_structure.building_demand.storey import Storey
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
from city_model_structure.attributes.point import Point from city_model_structure.attributes.point import Point
from city_model_structure.city_object import CityObject from city_model_structure.city_object import CityObject

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
import uuid import uuid
from city_model_structure.attributes.material import Material from city_model_structure.building_demand.material import Material
class Layer: class Layer:

View File

@ -8,9 +8,9 @@ from __future__ import annotations
from typing import List from typing import List
import numpy as np import numpy as np
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.thermal_boundary import ThermalBoundary from city_model_structure.building_demand.thermal_boundary import ThermalBoundary
from city_model_structure.attributes.thermal_zone import ThermalZone from city_model_structure.building_demand.thermal_zone import ThermalZone
import helpers.constants as cte import helpers.constants as cte

View File

@ -11,8 +11,8 @@ import uuid
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
from city_model_structure.attributes.plane import Plane from city_model_structure.attributes.plane import Plane
from city_model_structure.attributes.point import Point from city_model_structure.attributes.point import Point
from city_model_structure.attributes.pv_system import PvSystem from city_model_structure.energy_systems.pv_system import PvSystem
from city_model_structure.attributes.thermal_boundary import ThermalBoundary from city_model_structure.building_demand.thermal_boundary import ThermalBoundary
import helpers.constants as cte import helpers.constants as cte

View File

@ -5,8 +5,8 @@ Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc
Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from typing import List, TypeVar, Union from typing import List, TypeVar, Union
from city_model_structure.attributes.layer import Layer from city_model_structure.building_demand.layer import Layer
from city_model_structure.attributes.thermal_opening import ThermalOpening from city_model_structure.building_demand.thermal_opening import ThermalOpening
ThermalZone = TypeVar('ThermalZone') ThermalZone = TypeVar('ThermalZone')
Polygon = TypeVar('Polygon') Polygon = TypeVar('Polygon')

View File

@ -6,8 +6,8 @@ Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
import uuid import uuid
from typing import List, TypeVar from typing import List, TypeVar
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.usage_zone import UsageZone from city_model_structure.building_demand.usage_zone import UsageZone
ThermalBoundary = TypeVar('ThermalBoundary') ThermalBoundary = TypeVar('ThermalBoundary')
Polyhedron = TypeVar('Polyhedron') Polyhedron = TypeVar('Polyhedron')

View File

@ -3,9 +3,9 @@ CityObject 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 © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
from city_model_structure.attributes.sensor import Sensor from city_model_structure.iot.sensor import Sensor
from typing import List, Union from typing import List, Union
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.polyhedron import Polyhedron from city_model_structure.attributes.polyhedron import Polyhedron
from helpers.configuration_helper import ConfigurationHelper from helpers.configuration_helper import ConfigurationHelper

View File

@ -6,7 +6,7 @@ Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.mons
from abc import ABC from abc import ABC
from typing import List from typing import List
from city_model_structure.attributes.sensor import Sensor from city_model_structure.iot.sensor import Sensor
from city_model_structure.city_object import CityObject from city_model_structure.city_object import CityObject

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
""" """
from city_model_structure.attributes.sensor import Sensor from city_model_structure.iot.sensor import Sensor
import pandas as pd import pandas as pd

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from city_model_structure.attributes.sensor import Sensor from city_model_structure.iot.sensor import Sensor
import pandas as pd import pandas as pd

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
from city_model_structure.attributes.sensor import Sensor from city_model_structure.iot.sensor import Sensor
import pandas as pd import pandas as pd

View File

@ -0,0 +1,148 @@
"""
Traffic network 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
from city_model_structure.city_object import CityObject
from city_model_structure.transport.road_type import RoadType
from city_model_structure.transport.node import Node
from city_model_structure.transport.join import Join
from city_model_structure.transport.join_exclude import JoinExclude
from city_model_structure.transport.edge import Edge
from city_model_structure.transport.roundabout import Roundabout
from city_model_structure.transport.connection import Connection
from city_model_structure.transport.crossing import Crossing
from city_model_structure.transport.walking_area import WalkingArea
from city_model_structure.transport.traffic_light_logic import TrafficLightLogic
class TrafficNetwork(CityObject):
"""
TrafficNetwork(CityObject) class
"""
def __init__(self, name, lod, surfaces, city_lower_corner):
super().__init__(name, lod, surfaces, city_lower_corner)
self._types = None
self._nodes = None
self._joins = None
self._join_excludes = None
self._edges = None
self._roundabouts = None
self._connections = None
self._prohibitions = None
self._crossings = None
self._walking_areas = None
self._traffic_light_logics = None
@property
def types(self) -> List[RoadType]:
return self._types
@types.setter
def types(self, value):
"""
:param value: [RoadType]
"""
self._types = value
@property
def nodes(self) -> List[Node]:
return self._nodes
@nodes.setter
def nodes(self, value):
"""
:param value: [Node]
"""
self._nodes = value
@property
def joins(self) -> List[Join]:
return self._joins
@joins.setter
def joins(self, value):
"""
:param value: [Join]
"""
self._joins = value
@property
def join_excludes(self) -> List[JoinExclude]:
return self._join_excludes
@join_excludes.setter
def join_excludes(self, value):
"""
:param value: [JoinExclude]
"""
self._join_excludes = value
@property
def edges(self) -> List[Edge]:
return self._edges
@edges.setter
def edges(self, value):
"""
:param value: [Edge]
"""
self._edges = value
@property
def roundabouts(self) -> List[Roundabout]:
return self._roundabouts
@roundabouts.setter
def roundabouts(self, value):
"""
:param value: [Roundabout]
"""
self._roundabouts = value
@property
def connections(self) -> List[Connection]:
return self._connections
@connections.setter
def connections(self, value):
"""
:param value: [Connection]
"""
self._connections = value
@property
def crossings(self) -> List[Crossing]:
return self._crossings
@crossings.setter
def crossings(self, value):
"""
:param value: [Crossing]
"""
self._crossings = value
@property
def walking_areas(self) -> List[WalkingArea]:
return self._walking_areas
@walking_areas.setter
def walking_areas(self, value):
"""
:param value: [WalkingArea]
"""
self._walking_areas = value
@property
def traffic_light_logics(self) -> List[TrafficLightLogic]:
return self._traffic_light_logics
@traffic_light_logics.setter
def traffic_light_logics(self, value):
"""
:param value: [TrafficLightLogic]
"""
self._traffic_light_logics = value

View File

@ -0,0 +1,121 @@
"""
Connection 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 TypeVar
Edge = TypeVar['Edge']
Lane = TypeVar['Lane']
class Connection:
"""
Connection class
"""
def __init__(self):
self._from_edge = None
self._to_edge = None
self._from_lane = None
self._to_lane = None
self._pass = None
self._keep_clear = None
@property
def from_edge(self) -> Edge:
"""
Edge the vehicle leaves
:return: Edge
"""
return self._from_edge
@from_edge.setter
def from_edge(self, value):
"""
Edge the vehicle leaves setter
:param value: Edge
"""
self._from_edge = value
@property
def to_edge(self) -> Edge:
"""
Edge the vehicle reaches
:return: Edge
"""
return self._to_edge
@to_edge.setter
def to_edge(self, value):
"""
Edge the vehicle reaches setter
:param value: Edge
"""
self._to_edge = value
@property
def from_lane(self) -> Lane:
"""
Incoming lane
:return: Lane
"""
return self._to_lane
@from_lane.setter
def from_lane(self, value):
"""
Incoming lane setter
:param value: Lane
"""
self._from_lane = value
@property
def to_lane(self) -> Lane:
"""
Outgoing lane
:return: Lane
"""
return self._to_lane
@to_lane.setter
def to_lane(self, value):
"""
Outgoing lane setter
:param value: Lane
"""
self._to_lane = value
@property
def pass_not_wait(self):
"""
if set, vehicles which pass this (lane-2-lane) connection will not wait
:return: bool
"""
return self._pass
@pass_not_wait.setter
def pass_not_wait(self, value):
"""
pass_not_wait setter
:param value: bool
"""
self._pass = value
@property
def keep_clear(self):
"""
if set to false, vehicles which pass this (lane-2-lane) connection will not worry about blocking the intersection
:return: bool
"""
return self._keep_clear
@keep_clear.setter
def keep_clear(self, value):
"""
keep_clear setter
:param value: bool
"""
self._keep_clear = value

View File

@ -0,0 +1,104 @@
"""
Crossing 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
Edge = TypeVar['Edge']
Node = TypeVar['Node']
class Crossing:
"""
Crossing class
"""
def __init__(self):
self._node = None
self._edges = None
self._priority = None
self._width = None
self._shape = None
@property
def node(self) -> Node:
"""
The node at which this crossing is located
:return: Node
"""
return self._node
@node.setter
def node(self, value):
"""
The node at which this crossing is located setter
:param value: Node
"""
self._node = value
@property
def edges(self) -> List[Edge]:
"""
The (road) edges which are crossed
:return: [Edge]
"""
return self._edges
@edges.setter
def edges(self, value):
"""
The (road) edges which are crossed setter
:param value: [Edge]
"""
self._edges = value
@property
def priority(self):
"""
Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections).
:return: bool
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Priority setter
:param value: bool
"""
self._priority = value
@property
def width(self):
"""
Width in m
:return: float
"""
return self._width
@width.setter
def width(self, value):
"""
Width in m setter
:param value: float
"""
self._width = value
@property
def shape(self) -> List[List[float]]:
"""
List of positions (positions in m)
:return: [[x, y, (z)]]
"""
return self._shape
@shape.setter
def shape(self, value):
"""
List of positions setter
:param value: [[x, y, (z)]]
"""
self._shape = value

View File

@ -0,0 +1,168 @@
"""
Edge 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
Node = TypeVar['Node']
Lane = TypeVar['Lane']
class Edge:
"""
Edge class
Each edge is unidirectional and starts at the "from" node and ends at the "to" node
"""
def __init__(self):
self._id = None
self._from_node = None
self._to_node = None
self._type = None
self._lanes = None
self._number_lanes = None
self._priority = None
self._speed = None
self._length = None
@property
def id(self):
"""
Edge id
:return: str
"""
return self._id
@id.setter
def id(self, value):
"""
Edge id setter
:param value: str
"""
self._id = value
@property
def from_node(self) -> Node:
"""
Starting node
:return: Node
"""
return self._from_node
@from_node.setter
def from_node(self, value):
"""
Starting node setter
:param value: Node
"""
self._from_node = value
@property
def to_node(self) -> Node:
"""
Ending node
:return: Node
"""
return self._to_node
@to_node.setter
def to_node(self, value):
"""
Ending node setter
:param value: Node
"""
self._to_node = value
@property
def type(self):
"""
The name of a type within the SUMO edge type file
:return: str
"""
return self._type
@type.setter
def type(self, value):
"""
Type setter
:param value: str
"""
self._type = value
@property
def lanes(self) -> List[Lane]:
"""
List of lanes on an edge
:return: List[Lane]
"""
return self._lanes
@lanes.setter
def lanes(self, value):
"""
List of lanes on an edge setter
:param value: List[Lane]
"""
self._lanes = value
@property
def number_lanes(self):
"""
Number of default lanes on an edge
:return: int
"""
if self._number_lanes is None:
self._number_lanes = len(self.lanes)
return self._number_lanes
@property
def priority(self):
"""
A number, which determines the priority between different road types.
It starts with one; higher numbers represent more important roads.
:return: int
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Priority setter
:param value: int
"""
self._priority = value
@property
def speed(self):
"""
The speed limit in m/s
:return: float
"""
return self._speed
@speed.setter
def speed(self, value):
"""
The speed limit in m/s setter
:param value: float
"""
self._speed = value
@property
def length(self):
"""
Length in m
:return: float
"""
return self._length
@length.setter
def length(self, value):
"""
Length in m setter
:param value: float
"""
self._length = value

View File

@ -0,0 +1,36 @@
"""
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
"""
from typing import List, TypeVar
Node = TypeVar['Node']
class Join:
"""
Join class
"""
def __init__(self):
self._nodes = None
self._nodes_ids = None
@property
def nodes(self) -> List[Node]:
"""
List of nodes which are very close together forming a big cluster
:return: [Node]
"""
return self._nodes
@nodes.setter
def nodes(self, value):
"""
List of nodes setter
:param value: [Node]
"""
self._nodes = value

View File

@ -0,0 +1,36 @@
"""
Join Exclude 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
Node = TypeVar['Node']
class JoinExclude:
"""
JoinExclude class
"""
def __init__(self):
self._nodes = None
self._nodes_ids = None
@property
def nodes(self) -> List[Node]:
"""
List of nodes which are excluded from the big cluster
:return: [Node]
"""
return self._nodes
@nodes.setter
def nodes(self, value):
"""
List of nodes setter
:param value: [Node]
"""
self._nodes = value

View File

@ -0,0 +1,136 @@
"""
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):
"""
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):
"""
Index setter
:param value: int
"""
self._index = value
@property
def allow(self) -> List[str]:
"""
List of allowed vehicle classes
:return: [str]
"""
return self._allow
@allow.setter
def allow(self, value):
"""
List of allowed vehicle classes setter
:param value: [str]
"""
self._allow = value
@property
def disallow(self) -> List[str]:
"""
List of not allowed vehicle classes
:return: [str]
"""
return self._disallow
@disallow.setter
def disallow(self, value):
"""
List of not allowed vehicle classes setter
:param value: [str]
"""
self._disallow = value
@property
def change_left(self) -> List[str]:
"""
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):
"""
change_left setter
:param value: [str]
"""
self._change_left = value
@property
def change_right(self) -> List[str]:
"""
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):
"""
change_right setter
:param value: [str]
"""
self._change_right = value
@property
def speed(self):
"""
Speed in m/s
:return: float
"""
return self._speed
@speed.setter
def speed(self, value):
"""
Speed in m/s setter
:param value: float
"""
self._speed = value
@property
def width(self):
"""
Width in m
:return: float
"""
return self._width
@width.setter
def width(self, value):
"""
Width in m setter
:param value: float
"""
self._width = value

View File

@ -0,0 +1,92 @@
"""
Node 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
"""
class Node:
"""
Node class
"""
def __init__(self):
self._id = None
self._x = None
self._y = None
self._z = None
self._type = None
@property
def id(self):
"""
Node id
:return: str
"""
return self._id
@id.setter
def id(self, value):
"""
Node id setter
:param value: str
"""
self._id = value
@property
def x(self):
"""
The x-position of the node on the plane in m
:return: float
"""
return self._x
@x.setter
def x(self, value):
"""
The x-position of the node on the plane in m setter
:param value: float
"""
self._x = value
@property
def y(self):
"""
The y-position of the node on the plane in m
:return: float
"""
return self._y
@y.setter
def y(self, value):
"""
The y-position of the node on the plane in m setter
:param value: float
"""
self._y = value
@property
def z(self):
"""
The z-position of the node on the plane in m
:return: float
"""
return self._z
@z.setter
def z(self, value):
"""
The z-position of the node on the plane in m setter
:param value: float
"""
self._z = value
@property
def type(self):
"""
Type
enum ( "priority", "traffic_light", "right_before_left", "unregulated", "priority_stop", "traffic_light_unregulated", "allway_stop", "rail_signal", "zipper", "traffic_light_right_on_red", "rail_crossing")
:return: enum
"""
return self._type

View File

@ -0,0 +1,125 @@
"""
Phase 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 Phase:
"""
Phase class
"""
def __init__(self):
self._duration = None
self._state = None
self._min_duration = None
self._max_duration = None
self._name = None
self._next = None
@property
def duration(self):
"""
Duration in seconds
:return: int
"""
return self._duration
@duration.setter
def duration(self, value):
"""
Duration setter
:param value: int
"""
self._duration = value
@property
def state(self):
"""
List of signal states
:return: []
"""
return self._state
@state.setter
def state(self, value):
"""
List of signal states setter
:param value: []
"""
self._state = value
@property
def min_duration(self):
"""
Minimum duration in seconds
:return: int
"""
if self._min_duration is None:
self._min_duration = self._duration
return self._min_duration
@min_duration.setter
def min_duration(self, value):
"""
Minimum duration setter
:param value: int
"""
self._min_duration = value
@property
def max_duration(self):
"""
Maximum duration in seconds
:return: int
"""
if self._max_duration is None:
self._max_duration = self._duration
return self._max_duration
@max_duration.setter
def max_duration(self, value):
"""
Maximum duration setter
:param value: int
"""
self._max_duration = value
@property
def name(self):
"""
Phase name
:return: str
"""
return self._name
@name.setter
def name(self, value):
"""
Phase name setter
:param value: str
"""
self._name = value
@property
def next(self) -> List[int]:
"""
The next phase in the cycle after the current.
This is useful when adding extra transition phases to a traffic light plan which are not part of every cycle.
Traffic lights of type 'actuated' can make use of a list of indices for selecting among alternative
successor phases.
:return: [int]
"""
return self._next
@next.setter
def next(self, value):
"""
Next setter
:param value: [int]
"""
self._next = value

View File

@ -0,0 +1,166 @@
"""
Road Type 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']
class RoadType:
"""
RoadType class
"""
def __init__(self):
self._id = None
self._allow = None
self._disallow = None
self._discard = False
self._lanes = None
self._number_lanes = None
self._priority = None
self._speed = None
self._sidewalk_width = -1
@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 allow(self) -> List[str]:
"""
List of allowed vehicle classes
:return: [str]
"""
return self._allow
@allow.setter
def allow(self, value):
"""
List of allowed vehicle classes setter
:param value: [str]
"""
self._allow = value
@property
def disallow(self) -> List[str]:
"""
List of not allowed vehicle classes
:return: [str]
"""
return self._disallow
@disallow.setter
def disallow(self, value):
"""
List of not allowed vehicle classes setter
:param value: [str]
"""
self._disallow = value
@property
def discard(self) -> bool:
"""
If "yes", edges of that type are not imported
:return: bool
"""
return self._discard
@discard.setter
def discard(self, value):
"""
Discard setter
:param value: bool
"""
self._discard = value
@property
def lanes(self) -> List[Lane]:
"""
List of default lanes on an edge
:return: List[Lane]
"""
return self._lanes
@lanes.setter
def lanes(self, value):
"""
List of default lanes on an edge setter
:param value: List[Lane]
"""
self._lanes = value
@property
def number_lanes(self):
"""
Number of default lanes on an edge
:return: int
"""
if self._number_lanes is None:
self._number_lanes = len(self.lanes)
return self._number_lanes
@property
def priority(self):
"""
A number, which determines the priority between different road types.
It starts with one; higher numbers represent more important roads.
:return: int
"""
return self._priority
@priority.setter
def priority(self, value):
"""
Priority setter
:param value: int
"""
self._priority = value
@property
def speed(self):
"""
The default (implicit) speed limit in m/s
:return: float
"""
return self._speed
@speed.setter
def speed(self, value):
"""
The default (implicit) speed limit in m/s setter
:param value: float
"""
self._speed = value
@property
def sidewalk_width(self):
"""
The default width for added sidewalks in m
:return: float
"""
return self._sidewalk_width
@sidewalk_width.setter
def sidewalk_width(self, value):
"""
The default width for added sidewalks in m setter
:param value: float
"""
self._sidewalk_width = value

View File

@ -0,0 +1,35 @@
"""
Roundabout 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
Edge = TypeVar['Edge']
class Roundabout:
"""
Roundabout class
"""
def __init__(self):
self._edges = None
@property
def edges(self) -> List[Edge]:
"""
Edges that conform the roundabout
:return: [Edge]
"""
return self._edges
@edges.setter
def edges(self, value):
"""
Edges that conform the roundabout setter
:param value: [Edge]
"""
self._edges = value

View File

@ -0,0 +1,122 @@
"""
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

View File

@ -0,0 +1,105 @@
"""
Traffic light Logic module
These network elements are used to connect multiple side walks and pedestrian crossings
(typically one in each corner of an intersection).
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
Phase = TypeVar['Phase']
class TrafficLightLogic:
"""
TrafficLightLogic class
"""
def __init__(self):
self._id = None
self._type = None
self._program_id = None
self._offset = None
self._phases = None
@property
def id(self):
"""
Traffic light's id
:return: str
"""
return self._id
@id.setter
def id(self, value):
"""
Traffic light's id setter
:param value: str
"""
self._id = value
@property
def type(self):
"""
enum (static, actuated, delay_based)
:return:
"""
return self._type
@type.setter
def type(self, value):
"""
Type setter
:param value:
"""
self._type = value
@property
def program_id(self):
"""
Traffic light program's id
:return: str
"""
return self._program_id
@program_id.setter
def program_id(self, value):
"""
Traffic light program's id setter
:param value: str
"""
self._program_id = value
@property
def offset(self):
"""
The initial time offset of the program
:return: int
"""
return self._offset
@offset.setter
def offset(self, value):
"""
The initial time offset of the program setter
:param value: int
"""
self._offset = value
@property
def phases(self) -> List[Phase]:
"""
Phases of the traffic light logic
:return: [Phase]
"""
return self._phases
@phases.setter
def phases(self, value):
"""
Phases setter
:param value: [Phase]
"""
self._phases = value

View File

@ -0,0 +1,70 @@
"""
Walking area 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
Edge = TypeVar['Edge']
Node = TypeVar['Node']
class WalkingArea:
"""
WalkingArea class
"""
def __init__(self):
self._node = None
self._edges = None
self._shape = None
@property
def node(self) -> Node:
"""
The node at which this walking area is located
:return: Node
"""
return self._node
@node.setter
def node(self, value):
"""
The node at which this walking area is located setter
:param value: Node
"""
self._node = value
@property
def edges(self) -> List[Edge]:
"""
The (road) edges which uniquely define the walking area
:return: [Edge]
"""
return self._edges
@edges.setter
def edges(self, value):
"""
The (road) edges which uniquely define the walking area setter
:param value: [Edge]
"""
self._edges = value
@property
def shape(self) -> List[List[float]]:
"""
List of positions (positions in m)
:return: [[x, y, (z)]]
"""
return self._shape
@shape.setter
def shape(self, value):
"""
List of positions setter
:param value: [[x, y, (z)]]
"""
self._shape = value

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
import pandas as pd import pandas as pd
from city_model_structure.attributes.occupants import Occupants from city_model_structure.building_demand.occupants import Occupants
import calendar as cal import calendar as cal
import helpers.constants as cte import helpers.constants as cte

View File

@ -8,8 +8,8 @@ import sys
from imports.construction.nrel_physics_interface import NrelPhysicsInterface from imports.construction.nrel_physics_interface import NrelPhysicsInterface
from imports.construction.helpers.construction_helper import ConstructionHelper from imports.construction.helpers.construction_helper import ConstructionHelper
from city_model_structure.attributes.layer import Layer from city_model_structure.building_demand.layer import Layer
from city_model_structure.attributes.material import Material from city_model_structure.building_demand.material import Material
class UsPhysicsParameters(NrelPhysicsInterface): class UsPhysicsParameters(NrelPhysicsInterface):

View File

@ -5,7 +5,7 @@ Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc
""" """
from imports.geometry.citygml_classes.citygml_base import CityGmlBase from imports.geometry.citygml_classes.citygml_base import CityGmlBase
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon

View File

@ -5,7 +5,7 @@ Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc
""" """
from imports.geometry.citygml_classes.citygml_base import CityGmlBase from imports.geometry.citygml_classes.citygml_base import CityGmlBase
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon
from imports.geometry.helpers.geometry_helper import GeometryHelper from imports.geometry.helpers.geometry_helper import GeometryHelper

View File

@ -8,7 +8,7 @@ from trimesh import Scene
import trimesh.geometry import trimesh.geometry
from city_model_structure.city import City from city_model_structure.city import City
from city_model_structure.building import Building from city_model_structure.building import Building
from city_model_structure.attributes.surface import Surface from city_model_structure.building_demand.surface import Surface
from city_model_structure.attributes.polygon import Polygon from city_model_structure.attributes.polygon import Polygon

View File

@ -5,7 +5,7 @@ Copyright © 2021 Project Author Guille Gutierrez guillermo.gutierrezmorote@conc
""" """
import pandas as pd import pandas as pd
from imports.sensors.concordia_file_report import ConcordiaFileReport from imports.sensors.concordia_file_report import ConcordiaFileReport
from city_model_structure.attributes.concordia_energy_sensor import ConcordiaEnergySensor from city_model_structure.iot.concordia_energy_sensor import ConcordiaEnergySensor
class ConcordiaEnergyConsumption(ConcordiaFileReport): class ConcordiaEnergyConsumption(ConcordiaFileReport):

View File

@ -8,7 +8,6 @@ import io
import json import json
from pathlib import Path from pathlib import Path
import pandas as pd import pandas as pd
from city_model_structure.attributes.concordia_energy_sensor import ConcordiaEnergySensor
class ConcordiaFileReport: class ConcordiaFileReport:

View File

@ -5,7 +5,7 @@ Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.mons
""" """
import pandas as pd import pandas as pd
from imports.sensors.concordia_file_report import ConcordiaFileReport from imports.sensors.concordia_file_report import ConcordiaFileReport
from city_model_structure.attributes.concordia_gas_flow_sensor import ConcordiaGasFlowSensor from city_model_structure.iot.concordia_gas_flow_sensor import ConcordiaGasFlowSensor
class ConcordiaGasFlow(ConcordiaFileReport): class ConcordiaGasFlow(ConcordiaFileReport):

View File

@ -5,7 +5,7 @@ Copyright © 2021 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.mons
""" """
import pandas as pd import pandas as pd
from imports.sensors.concordia_file_report import ConcordiaFileReport from imports.sensors.concordia_file_report import ConcordiaFileReport
from city_model_structure.attributes.concordia_temperature_sensor import ConcordiaTemperatureSensor from city_model_structure.iot.concordia_temperature_sensor import ConcordiaTemperatureSensor
class ConcordiaTemperature(ConcordiaFileReport): class ConcordiaTemperature(ConcordiaFileReport):

View File

@ -7,8 +7,8 @@ import sys
from imports.geometry.helpers.geometry_helper import GeometryHelper as gh from imports.geometry.helpers.geometry_helper import GeometryHelper as gh
from imports.usage.hft_usage_interface import HftUsageInterface from imports.usage.hft_usage_interface import HftUsageInterface
from city_model_structure.attributes.usage_zone import UsageZone from city_model_structure.building_demand.usage_zone import UsageZone
from city_model_structure.attributes.internal_gains import InternalGains from city_model_structure.building_demand.internal_gains import InternalGains
class HftUsageParameters(HftUsageInterface): class HftUsageParameters(HftUsageInterface):