diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /ero1/src/helper/output_debug.py | |
Diffstat (limited to 'ero1/src/helper/output_debug.py')
| -rw-r--r-- | ero1/src/helper/output_debug.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ero1/src/helper/output_debug.py b/ero1/src/helper/output_debug.py new file mode 100644 index 0000000..bcc521f --- /dev/null +++ b/ero1/src/helper/output_debug.py @@ -0,0 +1,36 @@ +import networkx as nx +import osmnx as ox +from src.generation.graph_generation import generate_graph +from src.helper.prune_maps import prune_verdun +from src.helper.display_graph import display_graph +from src.deneigeuses.directed_cpp import oriented_cpt, chinese_postman_greedy +from src.helper.export_to_kml import export_to_kml + +def output_debug(G, paths, connections, debug_mode): + # debug_print("Calcule de la distance total :", debug_mode) + # distance_drone, unused_distance = distance_total(G, paths, connections) + # debug_print(f"Distance total du drone en kilometre = {distance_drone}", debug_mode) + # debug_print(f"Distance Manqué (routes hors arrondissement) du drone en kilometre = {unused_distance}", debug_mode) + + # distance_opti = 4025.2333363147495 # distance_optimal(G) + # debug_print(f"Distance Optimal du drone en kilometre = {distance_opti}", debug_mode) + + # G_undirected = G.to_undirected() + # distance_ref = 0 + # for u, v, data in G_undirected.edges(data=True): + # distance_ref += data["length"] + # distance_ref /= 1000 + # debug_print(f"Distance total de Montréal en kilomètres = {distance_ref}", debug_mode) + tmp = generate_graph("Verdun, Montréal, Québec, Canada", debug_mode) + print("Graph généré") + tmp = prune_verdun(tmp, debug_mode) + print("Verdun pruné, nb_nodes : ", len(tmp.nodes), ", nb_edges : ", len(tmp.edges())) + print("cpt") + path = chinese_postman_greedy(tmp, debug=True) + print("cpt fini") + display_graph(tmp, "Verdun, Québec, Canada", False, last_call=True, double_sens=True) + export_to_kml(path, [], tmp, debug_mode) + #for edg in tmp.edges: + #print(edg, " ", tmp.get_edge_data(edg[0], edg[1])) + + return True
\ No newline at end of file |
