new class created

This commit is contained in:
sanam 2023-09-20 11:30:41 -04:00
parent a3028221e3
commit 482c06e4c2
2 changed files with 15 additions and 92 deletions

View File

@ -1,11 +1,10 @@
""" """
Construction catalog Archetype Stochastic_occupancy catalog Archetype
SPDX - License - Identifier: LGPL - 3.0 - or -later SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca
""" """
from hub.catalog_factories.data_models.construction.construction import Construction
class Archetype: class Archetype:
@ -15,27 +14,14 @@ class Archetype:
def __init__(self, archetype_id, def __init__(self, archetype_id,
name, name,
function, function,
climate_zone, climate_zone, stochastic_schedule
construction_period, ):
constructions,
average_storey_height,
thermal_capacity,
extra_loses_due_to_thermal_bridges,
indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on):
self._id = archetype_id self._id = archetype_id
self._name = name self._name = name
self._function = function self._function = function
self._climate_zone = climate_zone self._climate_zone = climate_zone
self._construction_period = construction_period self._stochastic_schedule
self._constructions = constructions
self._average_storey_height = average_storey_height
self._thermal_capacity = thermal_capacity
self._extra_loses_due_to_thermal_bridges = extra_loses_due_to_thermal_bridges
self._indirect_heated_ratio = indirect_heated_ratio
self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off
self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on
@property @property
def id(self): def id(self):
@ -70,86 +56,23 @@ class Archetype:
return self._climate_zone return self._climate_zone
@property @property
def constructions(self) -> [Construction]: def stchastic_schedule(self):
""" """
Get archetype constructions Get stochastic schedules from the code
:return: [Construction] :return: schedule
""" """
return self._constructions return self._stochastic_schedule
@property
def construction_period(self):
"""
Get archetype construction period
:return: str
"""
return self._construction_period
@property
def average_storey_height(self):
"""
Get archetype average storey height in m
:return: float
"""
return self._average_storey_height
@property
def thermal_capacity(self):
"""
Get archetype thermal capacity in J/m3K
:return: float
"""
return self._thermal_capacity
@property
def extra_loses_due_to_thermal_bridges(self):
"""
Get archetype extra loses due to thermal bridges in W/m2K
:return: float
"""
return self._extra_loses_due_to_thermal_bridges
@property
def indirect_heated_ratio(self):
"""
Get archetype indirect heated area ratio
:return: float
"""
return self._indirect_heated_ratio
@property
def infiltration_rate_for_ventilation_system_off(self):
"""
Get archetype infiltration rate for ventilation system off in 1/s
:return: float
"""
return self._infiltration_rate_for_ventilation_system_off
@property
def infiltration_rate_for_ventilation_system_on(self):
"""
Get archetype infiltration rate for ventilation system on in 1/s
:return: float
"""
return self._infiltration_rate_for_ventilation_system_on
def to_dictionary(self): def to_dictionary(self):
"""Class content to dictionary""" """Class content to dictionary"""
_constructions = [] _stochastic_schedule = []
for _construction in self.constructions: for _stochastic_schedule in self.stochastic_schedule:
_constructions.append(_construction.to_dictionary()) _stochastic_schedule.append(_stochastic_schedule.to_dictionary())
content = {'Archetype': {'id': self.id, content = {'Archetype': {'id': self.id,
'name': self.name, 'name': self.name,
'function': self.function, 'function': self.function,
'climate zone': self.climate_zone, 'climate zone': self.climate_zone,
'period of construction': self.construction_period, 'stochastic_schedule': self.stochastic_schedule
'average storey height [m]': self.average_storey_height,
'thermal capacity [J/m3K]': self.thermal_capacity,
'extra loses due to thermal bridges [W/m2K]': self.extra_loses_due_to_thermal_bridges,
'indirect heated ratio': self.indirect_heated_ratio,
'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off,
'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on,
'constructions': _constructions
} }
} }
return content return content

View File

@ -54,7 +54,7 @@ class Lighting:
return self._latent_fraction return self._latent_fraction
@property @property
def schedules(self) -> Union[None, List[Schedule]]: def schedules(self) -> Union[None, List[Schedule], List[Stochastic_Schedule]]:
""" """
Get schedules Get schedules
dataType = fraction dataType = fraction