Merge remote-tracking branch 'origin/some_improvements_in_city_model'

This commit is contained in:
Guille Gutierrez 2023-06-09 11:22:18 -04:00
commit 0c7d428aa6

View File

@ -14,6 +14,7 @@ import hub.helpers.constants as cte
from hub.city_model_structure.attributes.polyhedron import Polyhedron from hub.city_model_structure.attributes.polyhedron import Polyhedron
from hub.city_model_structure.building_demand.household import Household from hub.city_model_structure.building_demand.household import Household
from hub.city_model_structure.building_demand.internal_zone import InternalZone from hub.city_model_structure.building_demand.internal_zone import InternalZone
from hub.city_model_structure.building_demand.thermal_zone import ThermalZone
from hub.city_model_structure.building_demand.surface import Surface from hub.city_model_structure.building_demand.surface import Surface
from hub.city_model_structure.city_object import CityObject from hub.city_model_structure.city_object import CityObject
from hub.city_model_structure.energy_systems.energy_system import EnergySystem from hub.city_model_structure.energy_systems.energy_system import EnergySystem
@ -40,6 +41,7 @@ class Building(CityObject):
self._floor_area = None self._floor_area = None
self._roof_type = None self._roof_type = None
self._internal_zones = None self._internal_zones = None
self._thermal_zones = None
self._shell = None self._shell = None
self._aliases = [] self._aliases = []
self._type = 'building' self._type = 'building'
@ -115,6 +117,24 @@ class Building(CityObject):
self._internal_zones = [InternalZone(self.surfaces, self.floor_area)] self._internal_zones = [InternalZone(self.surfaces, self.floor_area)]
return self._internal_zones return self._internal_zones
@property
def thermal_zones(self) -> Union[None, List[ThermalZone]]:
"""
Get building thermal zones
For Lod up to 3, there can be more than one thermal zone per internal zone.
In LoD 4, there can be more than one internal zone, and therefore, only one thermal zone per internal zone
:return: [ThermalZone]
"""
if self._thermal_zones is None:
self._thermal_zones = []
for internal_zone in self.internal_zones:
if internal_zone.thermal_zones is None:
self._thermal_zones = None
return self._thermal_zones
for thermal_zone in internal_zone.thermal_zones:
self._thermal_zones.append(thermal_zone)
return self._thermal_zones
@property @property
def grounds(self) -> List[Surface]: def grounds(self) -> List[Surface]:
""" """