Zaktualizuj 'main.py'
This commit is contained in:
parent
2abfdf6239
commit
807eb522be
32
main.py
32
main.py
@ -25,6 +25,10 @@ if __name__ == "__main__":
|
|||||||
# AStar
|
# AStar
|
||||||
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:
|
||||||
|
|
||||||
@ -142,6 +148,20 @@ if __name__ == "__main__":
|
|||||||
goal = (x, y)
|
goal = (x, y)
|
||||||
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 != '':
|
||||||
|
Loading…
Reference in New Issue
Block a user