forked from s_ranjbar/city_retrofit
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:
parent
f820816f12
commit
9243a0a4d4
@ -45,11 +45,15 @@ class Node:
|
|||||||
@property
|
@property
|
||||||
def edges(self) -> List[Edge]:
|
def edges(self) -> List[Edge]:
|
||||||
"""
|
"""
|
||||||
get edges delimited by the node
|
Get edges delimited by the node
|
||||||
:return: [Edge]
|
:return: [Edge]
|
||||||
"""
|
"""
|
||||||
return self._edges
|
return self._edges
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def time_series(self) -> TimeSeries:
|
def time_series(self) -> TimeSeries:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._time_series
|
return self._time_series
|
||||||
|
@ -17,12 +17,24 @@ class Record:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def time(self):
|
def time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._time
|
return self._time
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def value(self):
|
def value(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._value
|
return self._value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def flag(self):
|
def flag(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._flag
|
return self._flag
|
||||||
|
@ -19,8 +19,16 @@ class TimeSeries:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def time_series_type(self):
|
def time_series_type(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._time_series_type
|
return self._time_series_type
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def records(self) -> List[Record]:
|
def records(self) -> List[Record]:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: List[Record]
|
||||||
|
"""
|
||||||
return self._records
|
return self._records
|
||||||
|
@ -25,16 +25,32 @@ class BusSystem(CityObject):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def bus_routes(self) -> List[BusNode]:
|
def bus_routes(self) -> List[BusNode]:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: [BusNode]
|
||||||
|
"""
|
||||||
return self._bus_routes
|
return self._bus_routes
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bus_network(self) -> BusNetwork:
|
def bus_network(self) -> BusNetwork:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: BusNetwork
|
||||||
|
"""
|
||||||
return self._bus_network
|
return self._bus_network
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def buses(self) -> List[Bus]:
|
def buses(self) -> List[Bus]:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: [Bus]
|
||||||
|
"""
|
||||||
return self._buses
|
return self._buses
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def restricted_polygons(self) -> List[Polygon]:
|
def restricted_polygons(self) -> List[Polygon]:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: [Polygon]
|
||||||
|
"""
|
||||||
return self._restricted_polygons
|
return self._restricted_polygons
|
||||||
|
@ -27,44 +27,88 @@ class Bus:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def maintenance_time(self):
|
def maintenance_time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._maintenance_time
|
return self._maintenance_time
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def charging_time(self):
|
def charging_time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._charging_time
|
return self._charging_time
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def recovery_time(self):
|
def recovery_time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self.maintenance_time + self.charging_time
|
return self.maintenance_time + self.charging_time
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vehicle_type(self):
|
def vehicle_type(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._vehicle_type
|
return self._vehicle_type
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def energy_consumption(self):
|
def energy_consumption(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._energy_consumption
|
return self._energy_consumption
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def trips_schedule(self) -> Schedule:
|
def trips_schedule(self) -> Schedule:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._trips_schedule
|
return self._trips_schedule
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def capacity(self):
|
def capacity(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._capacity
|
return self._capacity
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def maintenance_cost(self):
|
def maintenance_cost(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._maintenance_cost
|
return self._maintenance_cost
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def investment_cost(self):
|
def investment_cost(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._investment_cost
|
return self._investment_cost
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def charging_range(self):
|
def charging_range(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._charging_range
|
return self._charging_range
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def maximum_travel_range(self):
|
def maximum_travel_range(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._maximum_travel_range
|
return self._maximum_travel_range
|
||||||
|
@ -19,8 +19,16 @@ class BusDepot(BusNode):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def number_of_charging_poles(self):
|
def number_of_charging_poles(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._number_of_charging_poles
|
return self._number_of_charging_poles
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_of_available_buses(self):
|
def number_of_available_buses(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._number_of_available_buses
|
return self._number_of_available_buses
|
||||||
|
@ -38,4 +38,8 @@ class BusEdge(Edge):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def average_travel_time(self):
|
def average_travel_time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._average_travel_time
|
return self._average_travel_time
|
||||||
|
@ -24,16 +24,32 @@ class BusStop(BusNode):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def time_table(self):
|
def time_table(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._time_table
|
return self._time_table
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def average_hourly_passengers_demand(self) -> Schedule:
|
def average_hourly_passengers_demand(self) -> Schedule:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: Schedule
|
||||||
|
"""
|
||||||
return self._average_hourly_passengers_demand
|
return self._average_hourly_passengers_demand
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fast_charging_infrastructure(self) -> Union[None, FastChargingInfrastructure]:
|
def fast_charging_infrastructure(self) -> Union[None, FastChargingInfrastructure]:
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: FastChargingInfrastructure
|
||||||
|
"""
|
||||||
return self._fast_charging_infrastructure
|
return self._fast_charging_infrastructure
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def waiting_time(self):
|
def waiting_time(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._waiting_time
|
return self._waiting_time
|
||||||
|
@ -16,8 +16,16 @@ class FastChargingInfrastructure:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def electrical_demand(self):
|
def electrical_demand(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._electrical_demand
|
return self._electrical_demand
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def losses_in_grid(self):
|
def losses_in_grid(self):
|
||||||
|
"""
|
||||||
|
Add explanation here
|
||||||
|
:return: add type of variable here
|
||||||
|
"""
|
||||||
return self._losses_in_grid
|
return self._losses_in_grid
|
||||||
|
123
data/customized_imports/ashrae_archetypes.xml
Normal file
123
data/customized_imports/ashrae_archetypes.xml
Normal 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>
|
@ -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
|
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
|
||||||
"""
|
"""
|
||||||
@ -9,9 +9,9 @@ from imports.geometry.helpers.geometry_helper import GeometryHelper as gh
|
|||||||
from city_model_structure.building_demand.usage_zone import UsageZone
|
from city_model_structure.building_demand.usage_zone import UsageZone
|
||||||
|
|
||||||
|
|
||||||
class AshraeUsageParameters:
|
class SanamCustomizedUsageParameters:
|
||||||
"""
|
"""
|
||||||
AshraeUsageParameters class
|
SanamCustomizedUsageParameters class
|
||||||
"""
|
"""
|
||||||
def __init__(self, city, base_path):
|
def __init__(self, city, base_path):
|
||||||
super().__init__(base_path, 'ashrae_archetypes.xml')
|
super().__init__(base_path, 'ashrae_archetypes.xml')
|
29
imports/customized_imports_factory.py
Normal file
29
imports/customized_imports_factory.py
Normal 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
|
||||||
|
"""
|
@ -8,7 +8,6 @@ Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from imports.usage.hft_usage_parameters import HftUsageParameters
|
from imports.usage.hft_usage_parameters import HftUsageParameters
|
||||||
from imports.usage.ca_usage_parameters import CaUsageParameters
|
from imports.usage.ca_usage_parameters import CaUsageParameters
|
||||||
from imports.usage.ashrae_usage_parameters import AshraeUsageParameters
|
|
||||||
# todo: handle missing lambda and rise error.
|
# todo: handle missing lambda and rise error.
|
||||||
|
|
||||||
|
|
||||||
@ -39,12 +38,6 @@ class UsageFactory:
|
|||||||
"""
|
"""
|
||||||
return CaUsageParameters(self._city, self._base_path).enrich_buildings()
|
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):
|
def enrich(self):
|
||||||
"""
|
"""
|
||||||
Enrich the city given to the class using the usage factory given handler
|
Enrich the city given to the class using the usage factory given handler
|
||||||
|
Loading…
Reference in New Issue
Block a user