Print more information in main

This commit is contained in:
Emi Simpson 2023-02-12 16:19:13 -05:00
parent 8236281181
commit 2486e9bf97
Signed by: Emi
GPG key ID: A12F2C2FFDC3D847

View file

@ -13,13 +13,16 @@ from write_out import save_map
def main(terrain_path: str, elevation_path: str, checkpoints_path: str, image_output: str): def main(terrain_path: str, elevation_path: str, checkpoints_path: str, image_output: str):
world = unwrap_r(load_world_from_paths(terrain_path, elevation_path)) world = unwrap_r(load_world_from_paths(terrain_path, elevation_path))
checkpoints = unwrap_r(load_points(checkpoints_path)) checkpoints = unwrap_r(load_points(checkpoints_path))
print('All files loaded, begining search...')
maybe_path = pathfind_multi( maybe_path = pathfind_multi(
world.neighbors, world.neighbors,
world.heuristic, world.heuristic,
checkpoints checkpoints
) )
path, cost = unwrap_opt(maybe_path) path, cost = unwrap_opt(maybe_path)
print(f'Path found! Estimated time: {cost//60_000_000} minutes') print(f'Path found!\n\nEstimated time: {cost//60_000_000} minutes')
path_length = unwrap_r(world.calculate_path_length(path))
print(f'Estimated length: {path_length/1_000_000:.1f} kilometers')
save_map(image_output, world, path) save_map(image_output, world, path)
if __name__ == '__main__': if __name__ == '__main__':