From 3fa2425be0869a26f0eca2fb70d677a02cea3084 Mon Sep 17 00:00:00 2001 From: pilar Date: Tue, 26 May 2020 17:15:48 -0400 Subject: [PATCH] modifications in city_objects and init.py to define the relationship between thermal_zones and usage_zones --- city_model_structure/surface.py | 1 + city_model_structure/thermal_zone.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/city_model_structure/surface.py b/city_model_structure/surface.py index d3e8cbf8..522ad438 100644 --- a/city_model_structure/surface.py +++ b/city_model_structure/surface.py @@ -126,6 +126,7 @@ class Surface: self._inclination = np.arccos(self.normal[2]) return self._inclination + # todo: share wall @property def type(self): if self._type is None: diff --git a/city_model_structure/thermal_zone.py b/city_model_structure/thermal_zone.py index 4f9533db..2d33ad02 100644 --- a/city_model_structure/thermal_zone.py +++ b/city_model_structure/thermal_zone.py @@ -14,6 +14,7 @@ class ThermalZone: self._indirectly_heated_area_ratio = None self._infiltration_rate_system_on = None self._infiltration_rate_system_off = None + self._usage_zones = None @property def heated(self): @@ -84,3 +85,11 @@ class ThermalZone: def infiltration_rate_system_off(self, value): self._infiltration_rate_system_off = value + # todo: is it well defined? + def set_usage_zones(self, usage_zones_list): + if self._usage_zones is None: + self._usage_zones = [] + for usage_zone in usage_zones_list: + self._usage_zones.append((usage_zone.percentage, usage_zone.type)) + return self._usage_zones +