district_heating_network_an.../main.py

23 lines
768 B
Python

from DistrictHeatingNetworkCreator import DistrictHeatingNetworkCreator
from Scripts.road_processor import road_processor
from pathlib import Path
import time
from Scripts.geojson_graph_creator import networkx_to_geojson
location = [45.51663850312751, -73.59854314961274]
start_time = time.perf_counter()
roads_file = road_processor(location[1], location[0], 0.001)
buildings_file = Path('./input_files/buildings.geojson').resolve()
dhn_creator = DistrictHeatingNetworkCreator(buildings_file, roads_file)
network_graph = dhn_creator.run()
end_time = time.perf_counter()
elapsed_time = end_time - start_time
print(f"The simulation took {elapsed_time:.4f} seconds to run.")
networkx_to_geojson(network_graph)
dhn_creator.plot_network_graph()