mazeFinder.py
def findSolution(method,filterActionsValue,player, end_rect, walls):
    '''
    Used to call the correct problem and search method deteremined by the GUI
    Returns the path from a node
    '''
    pos = player.position
    problem = None
    if(filterActionsValue==1):
        problem = ProblemFilter((pos[0],pos[1],walls), (end_rect.x, end_rect.y))
    else:
        problem = Problem((pos[0],pos[1],walls), (end_rect.x, end_rect.y))
    solution = None
    if(method==0):
        solution = search.breadthFirstTreeSearch(problem)
    elif(method==1):
        solution = search.breadthFirstGraphSearch(problem)
    elif(method==2):
        solution = search.depthFirstTreeSearch(problem)
    elif(method==3):
        solution = search.depthFirstGraphSearch(problem)
    elif(method==4):
        solution = search.uniformCostSearch(problem)
    elif(method==5):
        solution = search.iterativeDeepeningSearch(problem)
    elif(method==6):
        solution = search.greedyTreeSearch(problem)
    elif(method==7):
        solution = search.greedyGraphSearch(problem)
    elif(method==8):
        solution = search.astarTreeSearch(problem)
    elif(method==9):
        solution = search.astarGraphSearch(problem)
    if(solution==None):
        raise Exception
    print(solution.path())
    return solution.path()

    Used to call the correct problem and search method deteremined by the GUI
    Returns the path from a node
    
Used to call the correct problem and search method deteremined by the GUI
Returns the path from a node
Used to call the correct problem and search method deteremined by the GUI Returns the path from a node
def findSolution(method,filterActionsValue,player, end_rect, walls):
    pos = player.position
    problem = None
    if(filterActionsValue==1):
        problem = ProblemFilter((pos[0],pos[1],walls), (end_rect.x, end_rect.y))
    else:
        problem = Problem((pos[0],pos[1],walls), (end_rect.x, end_rect.y))
    solution = None
    if(method==0):
        solution = search.breadthFirstTreeSearch(problem)
    elif(method==1):
        solution = search.breadthFirstGraphSearch(problem)
    elif(method==2):
        solution = search.depthFirstTreeSearch(problem)
    elif(method==3):
        solution = search.depthFirstGraphSearch(problem)
    elif(method==4):
        solution = search.uniformCostSearch(problem)
    elif(method==5):
        solution = search.iterativeDeepeningSearch(problem)
    elif(method==6):
        solution = search.greedyTreeSearch(problem)
    elif(method==7):
        solution = search.greedyGraphSearch(problem)
    elif(method==8):
        solution = search.astarTreeSearch(problem)
    elif(method==9):
        solution = search.astarGraphSearch(problem)
    if(solution==None):
        raise Exception
    print(solution.path())
    return solution.path()
def findSolution ( method , filterActionsValue , player , end_rect , walls ) : pos = player . position problem = None if ( filterActionsValue == 1 ) : problem = ProblemFilter ( ( pos [ 0 ] , pos [ 1 ] , walls ) , ( end_rect . x , end_rect . y ) ) else : problem = Problem ( ( pos [ 0 ] , pos [ 1 ] , walls ) , ( end_rect . x , end_rect . y ) ) solution = None if ( method == 0 ) : solution = search . breadthFirstTreeSearch ( problem ) elif ( method == 1 ) : solution = search . breadthFirstGraphSearch ( problem ) elif ( method == 2 ) : solution = search . depthFirstTreeSearch ( problem ) elif ( method == 3 ) : solution = search . depthFirstGraphSearch ( problem ) elif ( method == 4 ) : solution = search . uniformCostSearch ( problem ) elif ( method == 5 ) : solution = search . iterativeDeepeningSearch ( problem ) elif ( method == 6 ) : solution = search . greedyTreeSearch ( problem ) elif ( method == 7 ) : solution = search . greedyGraphSearch ( problem ) elif ( method == 8 ) : solution = search . astarTreeSearch ( problem ) elif ( method == 9 ) : solution = search . astarGraphSearch ( problem ) if ( solution == None ) : raise Exception print ( solution . path ( ) ) return solution . path ( )
Used to call the correct problem and search method deteremined by the GUI
Returns the path from a node
Used to call the correct problem and search method deteremined by the GUI Returns the path from a node
'''
    Used to call the correct problem and search method deteremined by the GUI
    Returns the path from a node
    '''
method
filterActionsValue
player
end_rect
walls