From 807eb522beec25185e235f6e7fc132f9cad5dd2f Mon Sep 17 00:00:00 2001 From: Dominik Zawadzki Date: Fri, 5 Jun 2020 12:18:45 +0000 Subject: [PATCH] Zaktualizuj 'main.py' --- main.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 4f17296..25fb91c 100644 --- a/main.py +++ b/main.py @@ -25,6 +25,10 @@ if __name__ == "__main__": # AStar goal = None path = '' + + #Dominik + check = 0 + queue = [] # Marcin Dobrowolski suggestionTreeRoot = SuggestionTree.buildTree(trainingData) @@ -48,13 +52,15 @@ if __name__ == "__main__": break if event.key == pygame.K_s: - tree.TasksList('check', [10, 3]) - tree.TasksList('eat', [5, 12]) - tree.TasksList('order', [12, 4]) - tree.TasksList('goToBar', [10, 10]) - tree.TasksList('check', [3, 4]) - tree.TasksList('eat', [10, 5]) + tree.TasksList('check', [2,3]) + tree.TasksList('eat', [9, 6]) + tree.TasksList('order', [4, 8]) + tree.TasksList('goToBar', [11, 4]) + tree.TasksList('check', [2, 9]) + tree.TasksList('eat', [1, 1]) + queue = tree.ReturnQueueList() tree.print() + check = 1 if event.key == pygame.K_m: @@ -142,6 +148,20 @@ if __name__ == "__main__": goal = (x, y) path = waiter.findPath(goal) 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 if path != '':