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-25 13:33:08 -04:00
parent f820816f12
commit 9243a0a4d4
13 changed files with 276 additions and 11 deletions

View File

@ -45,11 +45,15 @@ class Node:
@property
def edges(self) -> List[Edge]:
"""
get edges delimited by the node
Get edges delimited by the node
:return: [Edge]
"""
return self._edges
@property
def time_series(self) -> TimeSeries:
"""
Add explanation here
:return: add type of variable here
"""
return self._time_series

View File

@ -17,12 +17,24 @@ class Record:
@property
def time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._time
@property
def value(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._value
@property
def flag(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._flag

View File

@ -19,8 +19,16 @@ class TimeSeries:
@property
def time_series_type(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._time_series_type
@property
def records(self) -> List[Record]:
"""
Add explanation here
:return: List[Record]
"""
return self._records

View File

@ -25,16 +25,32 @@ class BusSystem(CityObject):
@property
def bus_routes(self) -> List[BusNode]:
"""
Add explanation here
:return: [BusNode]
"""
return self._bus_routes
@property
def bus_network(self) -> BusNetwork:
"""
Add explanation here
:return: BusNetwork
"""
return self._bus_network
@property
def buses(self) -> List[Bus]:
"""
Add explanation here
:return: [Bus]
"""
return self._buses
@property
def restricted_polygons(self) -> List[Polygon]:
"""
Add explanation here
:return: [Polygon]
"""
return self._restricted_polygons

View File

@ -27,44 +27,88 @@ class Bus:
@property
def maintenance_time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._maintenance_time
@property
def charging_time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._charging_time
@property
def recovery_time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self.maintenance_time + self.charging_time
@property
def vehicle_type(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._vehicle_type
@property
def energy_consumption(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._energy_consumption
@property
def trips_schedule(self) -> Schedule:
"""
Add explanation here
:return: add type of variable here
"""
return self._trips_schedule
@property
def capacity(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._capacity
@property
def maintenance_cost(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._maintenance_cost
@property
def investment_cost(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._investment_cost
@property
def charging_range(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._charging_range
@property
def maximum_travel_range(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._maximum_travel_range

View File

@ -19,8 +19,16 @@ class BusDepot(BusNode):
@property
def number_of_charging_poles(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._number_of_charging_poles
@property
def number_of_available_buses(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._number_of_available_buses

View File

@ -38,4 +38,8 @@ class BusEdge(Edge):
@property
def average_travel_time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._average_travel_time

View File

@ -24,16 +24,32 @@ class BusStop(BusNode):
@property
def time_table(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._time_table
@property
def average_hourly_passengers_demand(self) -> Schedule:
"""
Add explanation here
:return: Schedule
"""
return self._average_hourly_passengers_demand
@property
def fast_charging_infrastructure(self) -> Union[None, FastChargingInfrastructure]:
"""
Add explanation here
:return: FastChargingInfrastructure
"""
return self._fast_charging_infrastructure
@property
def waiting_time(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._waiting_time

View File

@ -16,8 +16,16 @@ class FastChargingInfrastructure:
@property
def electrical_demand(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._electrical_demand
@property
def losses_in_grid(self):
"""
Add explanation here
:return: add type of variable here
"""
return self._losses_in_grid

View File

@ -0,0 +1,123 @@
<?xml version="0.1" encoding="UTF-8" standalone="yes"?>
<buildingUsageLibrary>
<name>Ashrae values</name>
<description>Library created by Sanam from ANSI/ASHRAE Standard 62-2001</description>
<zoneUsageType>
<id>assembly</id>
<occupancy>
<occupancyDensity>0.15</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>health</id>
<occupancy>
<occupancyDensity>0.1</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>20</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>hotel</id>
<occupancy>
<occupancyDensity>0.11</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>manufacturing</id>
<occupancy>
<occupancyDensity>0.07</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>10</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>office</id>
<occupancy>
<occupancyDensity>0.05</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>restaurant</id>
<occupancy>
<occupancyDensity>0.7</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>7.5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>retail</id>
<occupancy>
<occupancyDensity>0.2</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>7.5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>school</id>
<occupancy>
<occupancyDensity>0.25</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>10</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>lab</id>
<occupancy>
<occupancyDensity>0.25</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>10</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>residential</id>
<endUses>
<ventilation>
<minimumVentilationRate>5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
<zoneUsageType>
<id>gymnasium</id>
<occupancy>
<occupancyDensity>0.3</occupancyDensity>
</occupancy>
<endUses>
<ventilation>
<minimumVentilationRate>7.5</minimumVentilationRate>
</ventilation>
</endUses>
</zoneUsageType>
</buildingUsageLibrary>

View File

@ -1,5 +1,5 @@
"""
AshraeUsageParameters model the usage properties
SanamCustomizedUsageParameters add two parameters to usage properties from ASHRAE
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
@ -9,9 +9,9 @@ from imports.geometry.helpers.geometry_helper import GeometryHelper as gh
from city_model_structure.building_demand.usage_zone import UsageZone
class AshraeUsageParameters:
class SanamCustomizedUsageParameters:
"""
AshraeUsageParameters class
SanamCustomizedUsageParameters class
"""
def __init__(self, city, base_path):
super().__init__(base_path, 'ashrae_archetypes.xml')

View File

@ -0,0 +1,29 @@
"""
CustomizedImportsFactory is used to import any information using user customized formats
This factory can only be called after calling the construction factory.
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from pathlib import Path
class CustomizedImportsFactory:
"""
CustomizedImportsFactory class
"""
def __init__(self, city, importer_class, base_path):
if base_path is None:
base_path = Path(Path(__file__).parent.parent / 'data/customized_imports')
self._city = city
self._importer_class = importer_class
self._base_path = base_path
for building in city.buildings:
if len(building.thermal_zones) == 0:
raise Exception('It seems that the customized imports factory is being called before the construction factory. '
'Please ensure that the construction factory is called first.')
def enrich(self):
"""
Enrich the city given to the class using the given importer class
:return: None
"""

View File

@ -8,7 +8,6 @@ Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
from pathlib import Path
from imports.usage.hft_usage_parameters import HftUsageParameters
from imports.usage.ca_usage_parameters import CaUsageParameters
from imports.usage.ashrae_usage_parameters import AshraeUsageParameters
# todo: handle missing lambda and rise error.
@ -39,12 +38,6 @@ class UsageFactory:
"""
return CaUsageParameters(self._city, self._base_path).enrich_buildings()
def _ashrae(self):
"""
Enrich the city by using ASHRAE information
"""
AshraeUsageParameters(self._city, self._base_path).enrich_buildings()
def enrich(self):
"""
Enrich the city given to the class using the usage factory given handler