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)