Add building unit class for occupancy
This commit is contained in:
parent
f3bf5172d8
commit
e1224521e6
|
@ -16,6 +16,7 @@ from city_model_structure.thermal_boundary import ThermalBoundary
|
||||||
from city_model_structure.thermal_zone import ThermalZone
|
from city_model_structure.thermal_zone import ThermalZone
|
||||||
from city_model_structure.usage_zone import UsageZone
|
from city_model_structure.usage_zone import UsageZone
|
||||||
from city_model_structure.city_object import CityObject
|
from city_model_structure.city_object import CityObject
|
||||||
|
from city_model_structure.building_unit import BuildingUnit
|
||||||
|
|
||||||
|
|
||||||
class Building(CityObject):
|
class Building(CityObject):
|
||||||
|
@ -246,7 +247,24 @@ class Building(CityObject):
|
||||||
@property
|
@property
|
||||||
def type(self):
|
def type(self):
|
||||||
"""
|
"""
|
||||||
City object type
|
building type
|
||||||
:return: str
|
:return: str
|
||||||
"""
|
"""
|
||||||
return self._type
|
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
|
||||||
|
|
48
city_model_structure/building_unit.py
Normal file
48
city_model_structure/building_unit.py
Normal file
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user