Zaktualizuj 'main.py'

This commit is contained in:
Dominik Zawadzki 2020-06-05 12:18:45 +00:00
parent 2abfdf6239
commit 807eb522be

32
main.py
View File

@ -26,6 +26,10 @@ if __name__ == "__main__":
goal = None goal = None
path = '' path = ''
#Dominik
check = 0
queue = []
# Marcin Dobrowolski # Marcin Dobrowolski
suggestionTreeRoot = SuggestionTree.buildTree(trainingData) suggestionTreeRoot = SuggestionTree.buildTree(trainingData)
@ -48,13 +52,15 @@ if __name__ == "__main__":
break break
if event.key == pygame.K_s: if event.key == pygame.K_s:
tree.TasksList('check', [10, 3]) tree.TasksList('check', [2,3])
tree.TasksList('eat', [5, 12]) tree.TasksList('eat', [9, 6])
tree.TasksList('order', [12, 4]) tree.TasksList('order', [4, 8])
tree.TasksList('goToBar', [10, 10]) tree.TasksList('goToBar', [11, 4])
tree.TasksList('check', [3, 4]) tree.TasksList('check', [2, 9])
tree.TasksList('eat', [10, 5]) tree.TasksList('eat', [1, 1])
queue = tree.ReturnQueueList()
tree.print() tree.print()
check = 1
if event.key == pygame.K_m: if event.key == pygame.K_m:
@ -143,6 +149,20 @@ if __name__ == "__main__":
path = waiter.findPath(goal) path = waiter.findPath(goal)
path = waiter.translatePath(path) path = waiter.translatePath(path)
# Dominik
if check == 1:
task = queue.pop(0)
goal = (task[2][0], task[2][1])
print(goal)
path = waiter.findPath(goal)
print(path)
path = waiter.translatePath(path)
print(path)
check = 0
if len(queue) != 0 and check == 0 and path == '':
check = 1
# AStar # AStar
if path != '': if path != '':
nextStep = path[0] nextStep = path[0]