Code Monkey home page Code Monkey logo

pacmanrl's Introduction

PacmanRL

Reinforcement learning algorithms applied to the Pacman game.

The Pacman game is the result of Pushkar's work for the Udacity class ud820.

The learners can be found in the qlearningAgents.py file.

Run

python pacman.py -p PacmanQAgent -x 800 -n 810 -l smallGrid
  • The -l parameter can be changed to use other maps (available in the layout folder).
  • The -p parameter can be changed to use other types of q-learners.
  • -x sets the number of training examples.
  • -n sets the total number of examples (train + test)

Learners

  • PacmanQAgent: basic Q-learning agent. It uses full states (the whole map), and thus doesn't scale when using big maps.

Run it:

python pacman.py -g DirectionalGhost -p PacmanQAgent -x 800 -n 810 -l smallGrid
  • ApproximateQAgent: Uses a few predifined features to describe a state. What is learnt is how to combine these features to take a decision. This one can be used on big maps. The main drawback of this method is that Pacman is almost blind, as it only know what's happening in his 4 adjacent cells. It can easily get stuck in a corner because it doesn't know where the food is.

Run it:

python pacman.py -g DirectionalGhost -p ApproximateQAgent -x 400 -n 410 -l smallGrid
  • PerceptronQAgent: Learns using a perceptron. The input is what is in the cells near-by. Unlike with the previous learner, Pacman has access to a range of cells around him (defined via parameter). [under development]

Run it:

python pacman.py -g DirectionalGhost -p PerceptronQAgent -x 2000 -n 2010 -d

pacmanrl's People

Contributors

philippemorere avatar

Watchers

James Cloos 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.