A_star #2

Merged
s452622 merged 2 commits from A_star into master 2021-05-16 12:00:44 +02:00
Showing only changes of commit 04bbaedb4c - Show all commits

View File

@ -63,11 +63,11 @@ def main():
if event.key == pg.K_t: if event.key == pg.K_t:
print('Starting to clear the sector') print('Starting to clear the sector')
while env.mine_count: while env.mine_count:
print('-'*20) print('-' * 20)
#path, actions = breadth_first_search(env.field, agent.x, agent.y, agent.direction) # path, actions = breadth_first_search(env.field, agent.x, agent.y, agent.direction)
path, actions = a_star (env.field, agent.x, agent.y, agent.direction, path, actions = a_star(env.field, agent.x, agent.y, agent.direction,
breadth_first_search_for_a_star (env.field, agent.x, agent.y, breadth_first_search_for_a_star(env.field, agent.x, agent.y,
agent.direction)) agent.direction))
if not path and not env.field[agent.y][agent.x].mine: if not path and not env.field[agent.y][agent.x].mine:
print('Unable to find path, rocks are in the way') print('Unable to find path, rocks are in the way')
break break