costs_workflow/main.py
2023-01-18 10:24:29 -05:00

45 lines
1.7 KiB
Python

"""
Costs Workflow
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from pathlib import Path
from imports.geometry_factory import GeometryFactory
from capital_cost import CapitalCost
from life_cycle_costs import LifeCycleCosts
from imports.construction_factory import ConstructionFactory
from catalog_factories.costs_catalog_factory import CostCatalogFactory
gml_file = 'one_building_in_kelowna.gml'
file = Path(gml_file).resolve()
city = GeometryFactory('citygml', file).city
ConstructionFactory('nrel', city).enrich()
# print(city.buildings)
number_of_years = 40
consumer_price_index = 0.1
catalog = CostCatalogFactory('montreal_catalog').catalog
content = catalog.entries()
for building in city.buildings:
LifeCycleCosts.capital_cost(building, content)
catalog = CostCatalogFactory('montreal_catalog').catalog
content = catalog.entries()
# print(len(content.costs))
# lcc = LifeCycleCosts(building, number_of_years, consumer_price_index, costs_catalog)
# total_capital_costs = lcc.calculate_capital_costs()
# end_of_life_costs = lcc.calculate_end_of_life_costs()
# total_operational_costs = lcc.calculate_total_operational_costs()
# total_maintenance_costs = lcc.calculate_total_maintenance_costs()
# life_cycle_costs = total_capital_costs + end_of_life_costs + total_operational_costs + total_maintenance_costs
#
# print(f'Building name: {building.name}')
# print(f'Capital costs: {total_capital_costs}')
# print(f'End of life costs: {end_of_life_costs}')
# print(f'Operational costs: {total_operational_costs}')
# print(f'Maintenance costs: {total_maintenance_costs}')
# print(f'Life cycle costs: {life_cycle_costs}')