2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
UsageZone module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2021-06-09 14:23:45 -04:00
|
|
|
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2020-11-26 09:26:55 -05:00
|
|
|
Contributors Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-26 12:53:27 -04:00
|
|
|
import uuid
|
2021-03-16 13:43:59 -04:00
|
|
|
from typing import List, TypeVar
|
|
|
|
|
|
|
|
InternalGains = TypeVar('InternalGains')
|
|
|
|
Occupants = TypeVar('Occupants')
|
|
|
|
Polyhedron = TypeVar('Polyhedron')
|
2021-09-01 17:36:02 -04:00
|
|
|
Schedule = TypeVar('Schedule')
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
class UsageZone:
|
|
|
|
"""
|
|
|
|
UsageZone class
|
|
|
|
"""
|
2021-03-01 16:42:03 -05:00
|
|
|
def __init__(self):
|
2021-03-26 12:53:27 -04:00
|
|
|
self._id = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._usage = None
|
|
|
|
self._internal_gains = None
|
|
|
|
self._heating_setpoint = None
|
|
|
|
self._heating_setback = None
|
|
|
|
self._cooling_setpoint = None
|
|
|
|
self._hours_day = None
|
|
|
|
self._days_year = None
|
2020-11-06 05:32:19 -05:00
|
|
|
self._dhw_average_volume_pers_day = None
|
|
|
|
self._dhw_preparation_temperature = None
|
|
|
|
self._electrical_app_average_consumption_sqm_year = None
|
2021-03-01 16:42:03 -05:00
|
|
|
self._mechanical_air_change = None
|
2021-03-16 12:19:35 -04:00
|
|
|
self._occupants = None
|
2021-04-07 10:33:05 -04:00
|
|
|
self._schedules = None
|
2021-08-12 11:08:29 -04:00
|
|
|
self._volume = None
|
2021-03-16 13:43:59 -04:00
|
|
|
self._volume_geometry = None
|
2021-08-12 11:42:47 -04:00
|
|
|
self._is_heated = False
|
|
|
|
self._is_cooled = False
|
2020-12-15 11:05:02 -05:00
|
|
|
|
2021-03-26 12:53:27 -04:00
|
|
|
@property
|
|
|
|
def id(self):
|
2021-06-09 14:23:45 -04:00
|
|
|
"""
|
|
|
|
Get usage zone id, an universally unique identifier randomly generated
|
|
|
|
:return: str
|
|
|
|
"""
|
2021-03-26 12:53:27 -04:00
|
|
|
if self._id is None:
|
|
|
|
self._id = uuid.uuid4()
|
|
|
|
return self._id
|
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
@property
|
|
|
|
def internal_gains(self) -> List[InternalGains]:
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Get usage zone internal gains
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: [InternalGains]
|
|
|
|
"""
|
|
|
|
return self._internal_gains
|
|
|
|
|
|
|
|
@internal_gains.setter
|
|
|
|
def internal_gains(self, value):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Set usage zone internal gains
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: [InternalGains]
|
|
|
|
"""
|
|
|
|
self._internal_gains = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def heating_setpoint(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get usage zone heating set point in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._heating_setpoint
|
|
|
|
|
|
|
|
@heating_setpoint.setter
|
|
|
|
def heating_setpoint(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set usage zone heating set point in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._heating_setpoint = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def heating_setback(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get usage zone heating setback in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._heating_setback
|
|
|
|
|
|
|
|
@heating_setback.setter
|
|
|
|
def heating_setback(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set usage zone heating setback in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._heating_setback = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def cooling_setpoint(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get usage zone cooling setpoint in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._cooling_setpoint
|
|
|
|
|
|
|
|
@cooling_setpoint.setter
|
|
|
|
def cooling_setpoint(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set usage zone cooling setpoint in Celsius
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._cooling_setpoint = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def hours_day(self):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Get usage zone usage hours per day
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._hours_day
|
|
|
|
|
|
|
|
@hours_day.setter
|
|
|
|
def hours_day(self, value):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Set usage zone usage hours per day
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._hours_day = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def days_year(self):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Get usage zone usage days per year
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._days_year
|
|
|
|
|
|
|
|
@days_year.setter
|
|
|
|
def days_year(self, value):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Set usage zone usage days per year
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._days_year = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def mechanical_air_change(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get usage zone mechanical air change in air change per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._mechanical_air_change
|
|
|
|
|
|
|
|
@mechanical_air_change.setter
|
|
|
|
def mechanical_air_change(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set usage zone mechanical air change in air change per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._mechanical_air_change = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def usage(self):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Get usage zone usage
|
2020-10-28 13:42:58 -04:00
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
return self._usage
|
|
|
|
|
|
|
|
@usage.setter
|
|
|
|
def usage(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set usage zone usage
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: str
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._usage = str(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-06-09 14:23:45 -04:00
|
|
|
def occupants(self) -> List[Occupants]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 13:43:59 -04:00
|
|
|
Get occupants data
|
|
|
|
:return: [Occupants]
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
return self._occupants
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2021-03-16 12:19:35 -04:00
|
|
|
@occupants.setter
|
|
|
|
def occupants(self, values):
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 13:43:59 -04:00
|
|
|
Set occupants data
|
|
|
|
:param values: [Occupants]
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
self._occupants = values
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-01 17:36:02 -04:00
|
|
|
def schedules(self) -> List[Schedule]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-09-01 17:36:02 -04:00
|
|
|
Get usage zone schedules
|
|
|
|
:return: List[Schedule]
|
2021-04-07 10:33:05 -04:00
|
|
|
"""
|
|
|
|
return self._schedules
|
|
|
|
|
|
|
|
@schedules.setter
|
|
|
|
def schedules(self, values):
|
|
|
|
"""
|
2021-09-01 17:36:02 -04:00
|
|
|
Set usage zone schedules
|
|
|
|
:param values: List[Schedule]
|
2021-04-07 10:33:05 -04:00
|
|
|
"""
|
|
|
|
self._schedules = values
|
|
|
|
|
2020-11-06 05:32:19 -05:00
|
|
|
@property
|
|
|
|
def dhw_average_volume_pers_day(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get average DHW consumption in cubic meters per person per day
|
2020-11-06 05:32:19 -05:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._dhw_average_volume_pers_day
|
|
|
|
|
|
|
|
@dhw_average_volume_pers_day.setter
|
|
|
|
def dhw_average_volume_pers_day(self, values):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set average DHW consumption in cubic meters per person per day
|
2020-11-06 05:32:19 -05:00
|
|
|
:param values: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._dhw_average_volume_pers_day = float(values)
|
2020-11-06 05:32:19 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def dhw_preparation_temperature(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get preparation temperature of the DHW in Celsius
|
2020-11-06 05:32:19 -05:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._dhw_preparation_temperature
|
|
|
|
|
|
|
|
@dhw_preparation_temperature.setter
|
2021-09-13 15:14:54 -04:00
|
|
|
def dhw_preparation_temperature(self, value):
|
2020-11-06 05:32:19 -05:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set preparation temperature of the DHW in Celsius
|
2021-09-13 15:14:54 -04:00
|
|
|
:param value: float
|
2020-11-06 05:32:19 -05:00
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._dhw_preparation_temperature = float(value)
|
2020-11-06 05:32:19 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def electrical_app_average_consumption_sqm_year(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get average consumption of electrical appliances in Joules hour per square meter and year (J/m2yr)
|
2020-11-06 05:32:19 -05:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._electrical_app_average_consumption_sqm_year
|
|
|
|
|
|
|
|
@electrical_app_average_consumption_sqm_year.setter
|
2021-09-13 15:14:54 -04:00
|
|
|
def electrical_app_average_consumption_sqm_year(self, value):
|
2020-11-06 05:32:19 -05:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set average consumption of electrical appliances in Joules per square meter and year (J/m2yr)
|
2021-09-13 15:14:54 -04:00
|
|
|
:param value: float
|
2020-11-06 05:32:19 -05:00
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._electrical_app_average_consumption_sqm_year = float(value)
|
2021-03-16 13:43:59 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def volume_geometry(self) -> Polyhedron:
|
|
|
|
"""
|
2021-08-12 11:08:29 -04:00
|
|
|
Get the polyhedron defined by the usage zone
|
2021-03-16 13:43:59 -04:00
|
|
|
:return: Polyhedron
|
|
|
|
"""
|
|
|
|
return self._volume_geometry
|
2021-08-12 11:08:29 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def volume(self):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get the volume in cubic meters
|
2021-08-12 11:08:29 -04:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._volume
|
|
|
|
|
|
|
|
@volume.setter
|
|
|
|
def volume(self, value):
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Set volume in cubic meters
|
2021-08-12 11:08:29 -04:00
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._volume = float(value)
|
2021-08-12 11:42:47 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def is_heated(self):
|
|
|
|
"""
|
|
|
|
Get thermal zone heated flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
|
|
|
return self._is_heated
|
|
|
|
|
|
|
|
@is_heated.setter
|
|
|
|
def is_heated(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal zone heated flag
|
|
|
|
:param value: Boolean
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._is_heated = bool(value)
|
2021-08-12 11:42:47 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def is_cooled(self):
|
|
|
|
"""
|
|
|
|
Get thermal zone cooled flag
|
|
|
|
:return: Boolean
|
|
|
|
"""
|
|
|
|
return self._is_cooled
|
|
|
|
|
|
|
|
@is_cooled.setter
|
|
|
|
def is_cooled(self, value):
|
|
|
|
"""
|
|
|
|
Set thermal zone cooled flag
|
|
|
|
:param value: Boolean
|
|
|
|
"""
|
2021-09-13 15:14:54 -04:00
|
|
|
self._is_cooled = bool(value)
|