fix: brakowalo total_cost przy wylowywaniu A_star2 w App.py

This commit is contained in:
Paulina Smierzchalska 2024-04-28 13:17:08 +02:00
parent 92c893c917
commit c0fe5766b0
1 changed files with 3 additions and 3 deletions

6
App.py
View File

@ -15,8 +15,8 @@ import random
bfs1_flag=False
bfs2_flag=False #Change this lines to show different bfs implementation
bfs3_flag=False
Astar = True
Astar2 = False
Astar = False
Astar2 = True
if bfs3_flag or Astar or Astar2:
Pole.stoneFlag = True
@ -97,7 +97,7 @@ def init_demo(): #Demo purpose
print_to_console("Nie można znaleźć ścieżki A*") # Wyświetl komunikat, jeśli nie znaleziono ścieżki
if (Astar2):
aStarRoot2,cost_list= AStar.A_star2({'x': 0, 'y': 0, 'direction': "E"}, pole, goalTreasure)
aStarRoot2,cost_list, total_cost= AStar.A_star2({'x': 0, 'y': 0, 'direction': "E"}, pole, goalTreasure)
if aStarRoot2:
print("Pełna ścieżka agenta:")
aStarRoot2.reverse()