diff --git a/city_model_structure/building.py b/city_model_structure/building.py index 8af372a3..6ee7477d 100644 --- a/city_model_structure/building.py +++ b/city_model_structure/building.py @@ -16,6 +16,7 @@ from city_model_structure.thermal_boundary import ThermalBoundary from city_model_structure.thermal_zone import ThermalZone from city_model_structure.usage_zone import UsageZone from city_model_structure.city_object import CityObject +from city_model_structure.building_unit import BuildingUnit class Building(CityObject): @@ -246,7 +247,24 @@ class Building(CityObject): @property def type(self): """ - City object type + building type :return: str """ return self._type + + @property + def building_units(self) -> [BuildingUnit]: + """ + Building units + :return: + """ + return self._building_units + + @building_units.setter + def building_units(self, value): + """ + Building units + :param value: [BuildingUnit] + :return: List of building units + """ + self._building_units = value diff --git a/city_model_structure/building_unit.py b/city_model_structure/building_unit.py new file mode 100644 index 00000000..bcc3b345 --- /dev/null +++ b/city_model_structure/building_unit.py @@ -0,0 +1,48 @@ +""" +Building module +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +""" +from builtins import float + +from city_model_structure.city_object import CityObject + + +class BuildingUnit(CityObject): + """ + BuildingUnit class + """ + + def __init__(self, number_of_rooms, floor_area, energy_certificate): + """ + Constructor + """ + self._number_of_rooms = number_of_rooms + self._floor_area = floor_area + self._energy_certificate = energy_certificate + + @property + def number_of_rooms(self): + """ + Get building unit number of rooms + :return: number of rooms + """ + return self._number_of_rooms + + @property + def floor_area(self): + """ + Building unit floor area in square meters + :return: float + """ + return self._floor_area + + @property + def energy_certificate(self): + """ + Building unit energy certificate + :return: energy_certificate + """ + #TODO: This is still not used, check in the future + return self._energy_certificate +