2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Lighting module
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
from typing import Union, List
|
2022-03-08 19:19:52 -05:00
|
|
|
from city_model_structure.attributes.schedule import Schedule
|
|
|
|
|
|
|
|
|
|
|
|
class Lighting:
|
|
|
|
"""
|
|
|
|
Lighting class
|
|
|
|
"""
|
|
|
|
def __init__(self):
|
2022-04-06 16:06:55 -04:00
|
|
|
self._density = None
|
2022-03-08 19:19:52 -05:00
|
|
|
self._convective_fraction = None
|
2022-03-17 18:49:44 -04:00
|
|
|
self._radiative_fraction = None
|
2022-03-08 19:19:52 -05:00
|
|
|
self._latent_fraction = None
|
2022-03-17 18:49:44 -04:00
|
|
|
self._schedules = None
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
@property
|
2022-04-06 16:06:55 -04:00
|
|
|
def density(self) -> Union[None, float]:
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Get lighting density in Watts per m2
|
|
|
|
:return: None or float
|
|
|
|
"""
|
2022-04-06 16:06:55 -04:00
|
|
|
return self._density
|
2022-03-08 19:19:52 -05:00
|
|
|
|
2022-04-06 16:06:55 -04:00
|
|
|
@density.setter
|
|
|
|
def density(self, value):
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Set lighting density in Watts per m2
|
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
if value is not None:
|
2022-04-06 16:06:55 -04:00
|
|
|
self._density = float(value)
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def convective_fraction(self) -> Union[None, float]:
|
|
|
|
"""
|
|
|
|
Get convective fraction
|
|
|
|
:return: None or float
|
|
|
|
"""
|
|
|
|
return self._convective_fraction
|
|
|
|
|
|
|
|
@convective_fraction.setter
|
|
|
|
def convective_fraction(self, value):
|
|
|
|
"""
|
|
|
|
Set convective fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
if value is not None:
|
|
|
|
self._convective_fraction = float(value)
|
|
|
|
|
|
|
|
@property
|
2022-03-17 18:49:44 -04:00
|
|
|
def radiative_fraction(self) -> Union[None, float]:
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Get radiant fraction
|
|
|
|
:return: None or float
|
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
return self._radiative_fraction
|
2022-03-08 19:19:52 -05:00
|
|
|
|
2022-03-17 18:49:44 -04:00
|
|
|
@radiative_fraction.setter
|
|
|
|
def radiative_fraction(self, value):
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Set radiant fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
if value is not None:
|
2022-03-17 18:49:44 -04:00
|
|
|
self._radiative_fraction = float(value)
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def latent_fraction(self) -> Union[None, float]:
|
|
|
|
"""
|
|
|
|
Get latent fraction
|
|
|
|
:return: None or float
|
|
|
|
"""
|
|
|
|
return self._latent_fraction
|
|
|
|
|
|
|
|
@latent_fraction.setter
|
|
|
|
def latent_fraction(self, value):
|
|
|
|
"""
|
|
|
|
Set latent fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
|
|
|
if value is not None:
|
|
|
|
self._latent_fraction = float(value)
|
|
|
|
|
|
|
|
@property
|
2022-03-17 18:49:44 -04:00
|
|
|
def schedules(self) -> Union[None, List[Schedule]]:
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
Get schedules
|
2022-04-06 16:06:55 -04:00
|
|
|
dataType = fraction
|
2022-03-17 18:49:44 -04:00
|
|
|
:return: None or [Schedule]
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
return self._schedules
|
2022-03-08 19:19:52 -05:00
|
|
|
|
2022-03-17 18:49:44 -04:00
|
|
|
@schedules.setter
|
|
|
|
def schedules(self, value):
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
Set schedules
|
2022-04-06 16:06:55 -04:00
|
|
|
dataType = fraction
|
2022-03-17 18:49:44 -04:00
|
|
|
:param value: [Schedule]
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
self._schedules = value
|