Implementation of different search algorithms for the Pacman game.
Credit for the code goes to http://ai.berkeley.edu.
Attribution Information: The Pacman AI projects were developed at UC Berkeley.
# The core projects and autograders were primarily created by John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu).
# Student side autograding was added by Brad Miller, Nick Hay, and Pieter Abbeel (pabbeel@cs.berkeley.edu).
To run and play the Pacman Game, type the following command in the Anaconda terminal:
To run the Python Pacman game, use the following command:
Click to reveal the command
python pacman.py
Two specific search algorithms implemented are:
1. Breadth First Search (BFS)
2. A Star Search (A*)
To run Breadth First Search (BFS) Algorithm, use the following commands:
python pacman.py -l mediumMaze -p SearchAgent -a fn=bfs
python pacman.py -l bigMaze -p SearchAgent -a fn=bfs -z .5
To run A* Algorithm, use the command below. By default, the heuristic function is nullHeuristic. You can set the heuristic function to manhattanHeuristic by specifying the heuristic parameter during run time.
python pacman.py -l bigMaze -z .5 -p SearchAgent -a fn=astar,heuristic=manhattanHeuristic