From 72e14799fe4c80399db85bb494fed45c11717731 Mon Sep 17 00:00:00 2001 From: sanam Date: Fri, 29 Sep 2023 14:53:37 -0400 Subject: [PATCH] Cluster class defined --- .../stochastic_occupancy_model/archetype.py | 23 ++++++++++++++----- .../stochastic_occupancy_model/cluster.py | 22 ++++++++++++++++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py index 740e676e..7cd2e800 100644 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/archetype.py @@ -12,12 +12,14 @@ class Archetype: """ def __init__(self, archetype_id, name, - function, + building_type, + building_subtype, climate_zone ): self._id = archetype_id self._name = name - self._function = function + self._building_type = building_type + self._building_subtype = building_subtype self._climate_zone = climate_zone self._clusters = clusters @@ -38,12 +40,20 @@ class Archetype: return self._name @property - def function(self): + def building_type(self): """ - Get archetype function + Get archetype type :return: str """ - return self._function + return self._building_type + + @property + def building_subtype(self): + """ + Get archetype type + :return: str + """ + return self._building_subtype @property def climate_zone(self): @@ -58,7 +68,8 @@ class Archetype: _stochastic_schedule = [] content = {'Archetype': {'id': self.id, 'name': self.name, - 'function': self.function, + 'building_type': self.building_type, + 'building_subtype': self.building_subtype, 'climate zone': self.climate_zone } } diff --git a/hub/catalog_factories/data_models/stochastic_occupancy_model/cluster.py b/hub/catalog_factories/data_models/stochastic_occupancy_model/cluster.py index 8f03501f..7c90d2f3 100644 --- a/hub/catalog_factories/data_models/stochastic_occupancy_model/cluster.py +++ b/hub/catalog_factories/data_models/stochastic_occupancy_model/cluster.py @@ -1,14 +1,32 @@ +""" +Stochastic_occupancy catalog Clusters +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2022 Concordia CERC group +Project Coder Sanam Dabirian sanam.dabirian@mail.concordia.ca +""" + + from hub.catalog_factories.data_models.usages.schedule import Schedule class Cluster: """ - Archetype class + Clusters class """ - def __init__(self): + def __init__(self, day_type, + schedules + ): self._day_type = day_type self._schedules = schedules + @property + def day_type(self): + """ + Get type of day (Weekday or Weekend) + :return: str + """ + return self._day_type + @property def schedules(self) -> [Schedule]: return self._schedules