From 8ca95ddde07435a72387bb8e3eefb284054d24d7 Mon Sep 17 00:00:00 2001 From: Pilar Date: Mon, 20 Feb 2023 07:30:38 -0500 Subject: [PATCH] implementing shared_surfaces method. Not working --- hub/city_model_structure/building.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index d5129142..8da9df71 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -44,6 +44,7 @@ class Building(CityObject): self._appliances_electrical_demand = dict() self._domestic_hot_water_heat_demand = dict() self._eave_height = None + self._neighbours = None self._grounds = [] self._roofs = [] self._walls = [] @@ -441,3 +442,15 @@ class Building(CityObject): for usage in internal_zone.usages: _usage = f'{_usage}{usage.name}_{usage.percentage} ' return _usage.rstrip() + + def identify_shared_walls(self): + """ + Identifies which building' walls adjoin the neighbouring building and saves that information in the + corresponding surfaces + """ + for wall in self.walls: + percentage = 0 + for building in self._neighbours: + for neighbour_wall in building.walls: + percentage += wall.shared_percentage(neighbour_wall) + wall.set_shared_percentage(percentage)