예제 #1
0
                U = PriorityQ.PriorityQ()
                LpaStar = Algorithm.LPAStar(gridWorld, U, HEURISTIC)

                start = time.time()
                LpaStar.computeShortestPath()
                end = time.time()

                calcFirstSearch = end - start
                drawPath = True
                getAndRenderResults()

                alg = LpaStar.alg

            if event.key == pygame.K_F8:  #Select D*Lite and run first search
                U = PriorityQ.PriorityQ()
                DStarLite = Algorithm.DStarLite(gridWorld, U, HEURISTIC)

                start = time.time()
                DStarLite.computeShortestPath()
                end = time.time()

                calcFirstSearch = end - start
                drawPath = True
                getAndRenderResults()
                alg = DStarLite.alg

            if event.key == pygame.K_RIGHT:  #Move forwards through path
                #print("right arrow")
                if currRobotPos <= lenP - 1:
                    currRobotPos += 1
                getAndRenderResults()