Zaktualizuj 'main.py'
This commit is contained in:
parent
2abfdf6239
commit
807eb522be
32
main.py
32
main.py
@ -26,6 +26,10 @@ if __name__ == "__main__":
|
||||
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:
|
||||
|
||||
@ -143,6 +149,20 @@ if __name__ == "__main__":
|
||||
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 != '':
|
||||
nextStep = path[0]
|
||||
|
Loading…
Reference in New Issue
Block a user