2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
UsageZone module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2020-11-26 09:26:55 -05:00
|
|
|
Copyright © 2020 Project Author Pilar Monsalvete pilar_monsalvete@yahoo.es
|
|
|
|
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')
|
|
|
|
Lighting = TypeVar('Lighting')
|
|
|
|
Occupants = TypeVar('Occupants')
|
|
|
|
Polyhedron = TypeVar('Polyhedron')
|
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
|
2020-11-06 05:32:19 -05:00
|
|
|
self._occupancy_density = None
|
2020-10-28 13:42:58 -04:00
|
|
|
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
|
2020-12-15 11:05:02 -05:00
|
|
|
self._lights = None
|
2021-03-16 12:19:35 -04:00
|
|
|
self._heating_schedule = None
|
|
|
|
self._cooling_schedule = None
|
2021-03-16 13:43:59 -04:00
|
|
|
self._ventilation_schedule = None
|
2021-04-07 10:33:05 -04:00
|
|
|
self._schedules = None
|
2021-03-16 13:43:59 -04:00
|
|
|
self._volume_geometry = None
|
2020-12-15 11:05:02 -05:00
|
|
|
|
2021-03-26 12:53:27 -04:00
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
if self._id is None:
|
|
|
|
self._id = uuid.uuid4()
|
|
|
|
return self._id
|
|
|
|
|
2020-12-15 11:05:02 -05:00
|
|
|
@property
|
|
|
|
def lights(self) -> List[Lighting]:
|
|
|
|
return self._lights
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def internal_gains(self) -> List[InternalGains]:
|
|
|
|
"""
|
|
|
|
Get usage zone internal gains
|
|
|
|
:return: [InternalGains]
|
|
|
|
"""
|
|
|
|
return self._internal_gains
|
|
|
|
|
|
|
|
@internal_gains.setter
|
|
|
|
def internal_gains(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone internal gains
|
|
|
|
:param value: [InternalGains]
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._internal_gains = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def heating_setpoint(self):
|
|
|
|
"""
|
|
|
|
Get usage zone heating set point in celsius grads
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._heating_setpoint
|
|
|
|
|
|
|
|
@heating_setpoint.setter
|
|
|
|
def heating_setpoint(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone heating set point in celsius grads
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._heating_setpoint = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def heating_setback(self):
|
|
|
|
"""
|
|
|
|
Get usage zone heating setback in celsius grads
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._heating_setback
|
|
|
|
|
|
|
|
@heating_setback.setter
|
|
|
|
def heating_setback(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone heating setback in celsius grads
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._heating_setback = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def cooling_setpoint(self):
|
|
|
|
"""
|
|
|
|
Get usage zone cooling setpoint in celsius grads
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._cooling_setpoint
|
|
|
|
|
|
|
|
@cooling_setpoint.setter
|
|
|
|
def cooling_setpoint(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone cooling setpoint in celsius grads
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._cooling_setpoint = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def hours_day(self):
|
|
|
|
"""
|
|
|
|
Get usage zone usage hours per day
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._hours_day
|
|
|
|
|
|
|
|
@hours_day.setter
|
|
|
|
def hours_day(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone usage hours per day
|
|
|
|
:param value: float
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
self._hours_day = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def days_year(self):
|
|
|
|
"""
|
|
|
|
Get usage zone usage days per year
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._days_year
|
|
|
|
|
|
|
|
@days_year.setter
|
|
|
|
def days_year(self, value):
|
|
|
|
"""
|
|
|
|
Set usage zone usage days per year
|
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._days_year = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def mechanical_air_change(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set 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-01-08 16:08:29 -05:00
|
|
|
Get usage zone mechanical air change in air change per hour (ACH)
|
2020-10-28 13:42:58 -04:00
|
|
|
:param value: float
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._mechanical_air_change = value
|
|
|
|
|
|
|
|
@property
|
|
|
|
def usage(self):
|
|
|
|
"""
|
|
|
|
Get usage zone usage
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
return self._usage
|
|
|
|
|
|
|
|
@usage.setter
|
|
|
|
def usage(self, value):
|
|
|
|
"""
|
|
|
|
Get usage zone usage
|
|
|
|
:param value: str
|
|
|
|
:return: None
|
|
|
|
"""
|
|
|
|
self._usage = value
|
|
|
|
|
|
|
|
@property
|
2021-03-16 12:19:35 -04:00
|
|
|
def occupants(self) -> [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-03-16 12:19:35 -04:00
|
|
|
def heating_schedule(self):
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 13:43:59 -04:00
|
|
|
Get heating schedule: list of 0, 1 that define whether the heating system should be OFF or ON
|
|
|
|
:return: dict{DataFrame(int)}
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
return self._heating_schedule
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2021-03-16 12:19:35 -04:00
|
|
|
@heating_schedule.setter
|
|
|
|
def heating_schedule(self, values):
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
heating schedule
|
2021-03-16 13:43:59 -04:00
|
|
|
:param values: dict{DataFrame(int)}
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
self._heating_schedule = values
|
2020-11-02 13:41:42 -05:00
|
|
|
|
|
|
|
@property
|
2021-03-16 12:19:35 -04:00
|
|
|
def cooling_schedule(self):
|
2020-11-02 13:41:42 -05:00
|
|
|
"""
|
2021-03-16 13:43:59 -04:00
|
|
|
Get cooling schedule: list of 0, 1 that define whether the cooling system should be OFF or ON
|
|
|
|
:return: dict{DataFrame(int)}
|
2020-11-02 13:41:42 -05:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
return self._cooling_schedule
|
2020-11-02 13:41:42 -05:00
|
|
|
|
2021-03-16 12:19:35 -04:00
|
|
|
@cooling_schedule.setter
|
|
|
|
def cooling_schedule(self, values):
|
2020-11-02 13:41:42 -05:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
cooling schedule
|
2021-03-16 13:43:59 -04:00
|
|
|
:param values: dict{DataFrame(int)}
|
2020-11-02 13:41:42 -05:00
|
|
|
"""
|
2021-03-16 12:19:35 -04:00
|
|
|
self._cooling_schedule = values
|
2020-11-06 05:32:19 -05:00
|
|
|
|
2021-03-16 13:43:59 -04:00
|
|
|
@property
|
|
|
|
def ventilation_schedule(self):
|
|
|
|
"""
|
|
|
|
Get ventilation schedule: list of 0, 1 that define whether the ventilation system should be OFF or ON
|
|
|
|
:return: dict{DataFrame(int)}
|
|
|
|
"""
|
|
|
|
return self._ventilation_schedule
|
|
|
|
|
|
|
|
@ventilation_schedule.setter
|
|
|
|
def ventilation_schedule(self, values):
|
|
|
|
"""
|
|
|
|
ventilation_schedule schedule
|
|
|
|
:param values: dict{DataFrame(int)}
|
|
|
|
"""
|
|
|
|
self._ventilation_schedule = values
|
|
|
|
|
2021-04-07 10:33:05 -04:00
|
|
|
@property
|
|
|
|
def schedules(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return self._schedules
|
|
|
|
|
|
|
|
@schedules.setter
|
|
|
|
def schedules(self, values):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self._schedules = values
|
|
|
|
|
2020-11-06 05:32:19 -05:00
|
|
|
@property
|
|
|
|
def occupancy_density(self):
|
|
|
|
"""
|
2021-05-26 18:17:23 -04:00
|
|
|
Get schedules density in persons per m2
|
2020-11-06 05:32:19 -05:00
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._occupancy_density
|
|
|
|
|
|
|
|
@occupancy_density.setter
|
|
|
|
def occupancy_density(self, values):
|
|
|
|
"""
|
2021-05-26 18:17:23 -04:00
|
|
|
schedules density in persons per m2
|
2020-11-06 05:32:19 -05:00
|
|
|
:param values: float
|
|
|
|
"""
|
|
|
|
self._occupancy_density = values
|
|
|
|
|
|
|
|
@property
|
|
|
|
def dhw_average_volume_pers_day(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get average DHW consumption in m3 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-01-08 16:08:29 -05:00
|
|
|
average DHW consumption in m3 per person per day
|
2020-11-06 05:32:19 -05:00
|
|
|
:param values: float
|
|
|
|
"""
|
|
|
|
self._dhw_average_volume_pers_day = values
|
|
|
|
|
|
|
|
@property
|
|
|
|
def dhw_preparation_temperature(self):
|
|
|
|
"""
|
|
|
|
Get preparation temperature of the DHW in degree Celsius
|
|
|
|
:return: float
|
|
|
|
"""
|
|
|
|
return self._dhw_preparation_temperature
|
|
|
|
|
|
|
|
@dhw_preparation_temperature.setter
|
|
|
|
def dhw_preparation_temperature(self, values):
|
|
|
|
"""
|
|
|
|
preparation temperature of the DHW in degree Celsius
|
|
|
|
:param values: float
|
|
|
|
"""
|
|
|
|
self._dhw_preparation_temperature = values
|
|
|
|
|
|
|
|
@property
|
|
|
|
def electrical_app_average_consumption_sqm_year(self):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get average consumption of electrical appliances in Joules hour per m2 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
|
|
|
|
def electrical_app_average_consumption_sqm_year(self, values):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
average consumption of electrical appliances in Joules per m2 and year (J/m2yr)
|
2020-11-06 05:32:19 -05:00
|
|
|
:param values: float
|
|
|
|
"""
|
|
|
|
self._electrical_app_average_consumption_sqm_year = values
|
2021-03-16 13:43:59 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def volume_geometry(self) -> Polyhedron:
|
|
|
|
"""
|
|
|
|
Get the polyhedron defined by the thermal zone
|
|
|
|
:return: Polyhedron
|
|
|
|
"""
|
|
|
|
return self._volume_geometry
|