added id to thermal_boundary.py and thermal_opening.py

erased \r from files generators
added generator of auxiliary files for dynamic model
This commit is contained in:
Pilar 2021-08-31 12:17:42 -04:00
parent aba2dd8a34
commit 44c4f666d2
2 changed files with 24 additions and 0 deletions

View File

@ -4,6 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
import uuid
from typing import List, TypeVar, Union from typing import List, TypeVar, Union
from city_model_structure.building_demand.layer import Layer from city_model_structure.building_demand.layer import Layer
from city_model_structure.building_demand.thermal_opening import ThermalOpening from city_model_structure.building_demand.thermal_opening import ThermalOpening
@ -19,6 +20,7 @@ class ThermalBoundary:
""" """
def __init__(self, surface): def __init__(self, surface):
self._surface = surface self._surface = surface
self._id = None
self._thermal_zones = None self._thermal_zones = None
# ToDo: up to at least LOD2 will be just one thermal opening per Thermal boundary only if window_ratio > 0, # ToDo: up to at least LOD2 will be just one thermal opening per Thermal boundary only if window_ratio > 0,
# review for LOD3 and LOD4 # review for LOD3 and LOD4
@ -41,6 +43,16 @@ class ThermalBoundary:
self._alpha_coefficient = None self._alpha_coefficient = None
self._radiative_coefficient = None self._radiative_coefficient = None
@property
def id(self):
"""
Get thermal zone id, an universally unique identifier randomly generated
:return: str
"""
if self._id is None:
self._id = uuid.uuid4()
return self._id
@property @property
def surface(self) -> Surface: def surface(self) -> Surface:
""" """

View File

@ -4,6 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
""" """
import uuid
from typing import TypeVar from typing import TypeVar
Polygon = TypeVar('Polygon') Polygon = TypeVar('Polygon')
@ -14,6 +15,7 @@ class ThermalOpening:
ThermalOpening class ThermalOpening class
""" """
def __init__(self): def __init__(self):
self._id = None
self._area = None self._area = None
self._openable_ratio = None self._openable_ratio = None
self._conductivity = None self._conductivity = None
@ -30,6 +32,16 @@ class ThermalOpening:
self._alpha_coefficient = None self._alpha_coefficient = None
self._radiative_coefficient = None self._radiative_coefficient = None
@property
def id(self):
"""
Get thermal zone id, an universally unique identifier randomly generated
:return: str
"""
if self._id is None:
self._id = uuid.uuid4()
return self._id
@property @property
def area(self): def area(self):
""" """