def start_eating_closest_dot():

    rules = pac.pacman.ClassicGameRules(0)
    sa = ClosestDotSearchAgent()
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(layout.getLayout('bigSearch'), sa, [], gameDisplay,
                         False, False)
    game.run()
def start_eating_dots():

    rules = pac.pacman.ClassicGameRules(0)
    sa = AStarFoodSearchAgent()
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(layout.getLayout('trickySearch'), sa, [], gameDisplay,
                         False, False)
    game.run()
def start_corner_problem():
    tiny_corner_layout = layout.getLayout('tinyCorners')
    medium_corner_layout = layout.getLayout('mediumCorners')
    rules = pac.pacman.ClassicGameRules(0)
    sa = SearchAgent(fn=breadthFirstSearch, prob=CornersProblem)
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(tiny_corner_layout, sa, [], gameDisplay, False, False)
    game.run()
Exemple #4
0
def start_eating_dots():
    rules = pac.pacman.ClassicGameRules(0)
    sa = AStarFoodSearchAgent()
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(
        layout.getLayout(
            'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\\trickySearch'
        ), sa, [], gameDisplay, False, False)
    game.run()
Exemple #5
0
def start_game():
    mr_pacman = SearchAgent(fn=aStarSearch, prob=PositionSearchProblem)
    ghosts = [RandomGhost(1),
              RandomGhost(2)]  # controls the behavior of two ghosts
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # initialize the display of the playing field
    lay = layout.getLayout(
        'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\mediumMaze'
    )  # load the layout of the map

    game = rules.newGame(lay, mr_pacman, ghosts, gameDisplay, False,
                         False)  # instantiate a Game instance, see below
    game.run(
    )  # run the game, until Pacman is caught by a ghost or there is no food left
Exemple #6
0
def start_corner_problem():
    tiny_corner_layout = layout.getLayout(
        'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\\tinyCorners'
    )  # load the layout of the map
    medium_corner_layout = layout.getLayout(
        'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\mediumCorners'
    )  # load the layout of the map
    rules = pac.pacman.ClassicGameRules(0)
    sa = SearchAgent(fn=breadthFirstSearch, prob=CornersProblem)
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(medium_corner_layout, sa, [], gameDisplay, False,
                         False)
    game.run()
def start_corner_problem_astar():
    tiny_corner_layout = layout.getLayout('tinyCorners')
    medium_corner_layout = layout.getLayout('mediumCorners')
    big_corner_layout = layout.getLayout('bigCorners')

    gameState = pacman.GameState()
    gameState.initialize(medium_corner_layout, 0)

    problem = CornersProblem(gameState)

    rules = pac.pacman.ClassicGameRules(0)
    sa = AStarCornersAgent()
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(layout.getLayout('mediumCorners'), sa, [],
                         gameDisplay, False, False)
    game.run()
Exemple #8
0
def start_corner_problem_astar():
    tiny_corner_layout = layout.getLayout(
        'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\\tinyCorners'
    )  # load the layout of the map
    medium_corner_layout = layout.getLayout(
        'C:\Users\Bernhard\AppData\Local\Programs\Python\Python27\Lib\site-packages\pacman-0.1-py2.7.egg\pac\layouts\mediumCorners'
    )  # load the layout of the map
    gameState = pacman.GameState()
    gameState.initialize(medium_corner_layout, 0)

    problem = CornersProblem(gameState)

    rules = pac.pacman.ClassicGameRules(0)
    sa = AStarCornersAgent()
    gameDisplay = graphicsDisplay.PacmanGraphics(
        frameTime=0.1)  # visualization
    game = rules.newGame(medium_corner_layout, sa, [], gameDisplay, False,
                         False)
    game.run()
def start_game():
    rules = pacman.ClassicGameRules(timeout=0)
    rules = pac.pacman.ClassicGameRules(0)

    from pac.pacmanAgents import GreedyAgent
    mr_pacman = SearchAgent(fn=breadthFirstSearch, prob=PositionSearchProblem)

    from pac.ghostAgents import RandomGhost
    ghosts = [RandomGhost(1),
              RandomGhost(2)]  # controls the behavior of two ghosts

    #gameDisplay = NotebookGraphics(sleep_time = 0.2)  # initialize the display of the playing field
    gameDisplay = graphicsDisplay.PacmanGraphics(frameTime=0.1)

    lay = layout.getLayout('tinyMaze')

    game = rules.newGame(lay, mr_pacman, ghosts, gameDisplay, False,
                         False)  # instantiate a Game instance, see below
    game.run(
    )  # run the game, until Pacman is caught by a ghost or there is no food left