ai-lab-one/main.py

24 lines
688 B
Python

from emis_funky_funktions import *
from sys import argv
from operator import eq
from a_star import pathfind_multi
from read_in import load_world_from_paths
from world import Point, World
from write_out import save_map
def main(terrain_path: str, elevation_path: str, path_output: str, image_output: str):
world = unwrap_r(load_world_from_paths(terrain_path, elevation_path))
maybe_path = pathfind_multi(
world.neighbors,
world.heuristic,
[Point(200, 475), Point(200, 100)]
)
print(maybe_path)
path, cost = unwrap_opt(maybe_path)
print(f'Path found! Estimated time: {cost//60000000} minutes')
save_map(path_output, world, path)
if __name__ == '__main__':
main(*argv[1:])