Coder Social home page Coder Social logo

vvkmnn / pacmanai Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 1.46 MB

๐ŸŽฎ A set of artificially intelligent Pacman agents, using different search strategies!

Python 100.00%
uniform-cost-search graph-search heuristic pacman breadth-first-search python artificial-intelligence

pacmanai's Introduction

pacmanAI

Another lab in the Artificial Intelligence Nanodegree program, that creates agents to play through Pacman!

To do this, we had to define code dealing with Depth-First Search, Breadth-First Search, Uniform-Cost Search / Cheapest-First, and the venerable A* Star Search which uses a combination of cost and a heuristic to further improve our Pacman's performance.

Please note that the majority of this code is not mine, and is maintained by the amazing guys over at Berkely, and brought to my attention by Udacity. search.py specifically has been modified to include my own attempts at solving this project.

The full Pacman project and details are available from Berkley.

Setup

This project requires Python 2 (Preferably as distributed by Anaconda) and can be visaluzed via Pygame to get a visualization like the one above.

After setting up (and jumping in the environment), this project can be run via the following commands:

No Search

    python2 pacman.py
    python2 pacman.py --layout testMaze --pacman GoWestAgent
    python2 pacman.py --layout tinyMaze --pacman GoWestAgent
    python2 pacman.py -h

Regular Search

    python2 pacman.py -l tinyMaze -p SearchAgent -a fn=tinyMazeSearch
    python2 pacman.py -l tinyMaze -p SearchAgent
    python2 pacman.py -l mediumMaze -p SearchAgent
    python2 pacman.py -l bigMaze -z .5 -p SearchAgent
    python2 pacman.py -l mediumMaze -p SearchAgent -a fn=bfs
    python2 pacman.py -l bigMaze -p SearchAgent -a fn=bfs -z .5
    python2 eightpuzzle.py
    python2 pacman.py -l mediumMaze -p SearchAgent -a fn=ucs
    python2 pacman.py -l mediumDottedMaze -p StayEastSearchAgent
    python2 pacman.py -l mediumScaryMaze -p StayWestSearchAgent

Heuristic Search

    python2 pacman.py -l bigMaze -z .5 -p SearchAgent -a fn=astar,heuristic=manhattanHeuristic 
    python2 pacman.py -l tinyCorners -p SearchAgent -a fn=bfs,prob=CornersProblem
    python2 pacman.py -l mediumCorners -p SearchAgent -a fn=bfs,prob=CornersProblem
    python2 pacman.py -l mediumCorners -p AStarCornersAgent -z 0.5
    python2 pacman.py -l testSearch -p AStarFoodSearchAgent
    python2 pacman.py -l trickySearch -p AStarFoodSearchAgent
    python2 pacman.py -l bigSearch -p ClosestDotSearchAgent -z .5 
    python2 pacman.py -l bigSearch -p ApproximateSearchAgent -z .5 -q 

pacmanai's People

Contributors

vvkmnn avatar

Watchers

 avatar  avatar  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.