Esempio n. 1
0
                drawKeyValues = False
                drawRHS = False
                drawG = False
                drawCellPos = False

                pos = pygame.mouse.get_pos()
                i, j = getGridCoord(pos)
                if [i, j] in drawLocal:
                    drawLocal.remove([i, j])
                else:
                    drawLocal.append([i, j])
                    gridWorld.map[i][j].printNeighbours()

            if event.key == pygame.K_F7:  #Select LPA* and run first search
                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)