Coder Social home page Coder Social logo

junthbasnet / pacman-search Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 10.72 MB

Array of AI Search algorithms is employed to playing Pac-Man ⍩⃝.

Python 100.00%
pacman-game pacman-agent breadth-first-search depth-first-search uniform-cost-search astar-search-algorithm minimax-search alpha-beta-pruning informed-search uninformed-search

pacman-search's Introduction

Pacman Search


An array of AI techniques is employed to playing Pac-Man . Following Informed, Uninformed and Adversarial Search algorithms are implemented in this project.

  • Informed Search:
    • Breadth First Search
    • Depth First Search
    • Uniform Cost Search
  • Uninformed Search:
    • A* Search
  • Adversarial Search:
    • Minimax Search
    • Alpha-Beta Pruning

1. Depth First Search

Expand deepest node.

cd Informed and Uninformed Search
python pacman.py -l mediumMaze -p SearchAgent -z .8 --frameTime 0.05

2. Breadth First Search

Expand shallowest node.

cd Informed and Uninformed Search
python pacman.py -l mediumMaze -p SearchAgent -a fn=bfs -z .8 --frameTime 0.05

3. Uniform Cost Search

Expand least cost node.

cd Informed and Uninformed Search
python pacman.py -l mediumMaze -p SearchAgent -a fn=ucs -z .8 --frameTime 0.05

4. A* Search

Minimize the total estimated solution cost.

cd Informed and Uninformed Search
python pacman.py -l mediumMaze -p SearchAgent -a fn=astar,heuristic=manhattanHeuristic -z .8 --frameTime 0.05

5. Adversarial Search (Minimax)

Max maximizes results, Min minimizes results. Compute each node’s minimax value’s the best achievable utility against an optimal adversary.

cd Adversarial Search
python pacman.py -p MinimaxAgent -l smallClassic -a depth=2 --frameTime 0

If you lose, try increasing depth because depth matters.

6. Alpha-Beta Pruning

Minimax: generates the entire game search space. Alpha-Beta algorithm: prune large chunks of the trees.

cd Adversarial Search
python pacman.py -p AlphaBetaAgent -l smallClassic -a depth=3 --frameTime 0

If you lose, try increasing depth because depth matters.

References

UC Berkeley's introductory artificial intelligence course, CS 188.

pacman-search's People

Contributors

junthbasnet avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.