Git Product home page Git Product logo

pacman-mdp-agent's Introduction

Pac-Man MDP Agent

This work shows the implementation and statistical analysis of an AI agent capable of winning the arcade game of Pac-Man using an MDP solver that follows a policy based on Value Iteration.

A full report can be found here.

The game itself is also modelled as a stochastic variation of the Pac-Man game, meaning that some transitions are probabilistic. In the context of the Pac-Man game, the agent has an 80% probability of going in the direction specified by the policy, and a 10% change of going to either direction perpendicular to that.If the agent hits a wall, it will not move.

The sole file here is meant to be used with Berkley's Pac-Man Projects . It therefore only contains the logic associated with a MDP agent trying to win the Pac-Man game.

Example Game

Environment

The code is meant to be run on Python 2.7

Instructions

Run the agent on a small grid:

python pacman.py -p MDPAgent -l smallGrid

Additional tags

Game tags

  • -q to run without UI
  • -l to specify the layout (the code was written for -l smallGrid and -l mediumClassic)
  • -n to specify how many times to run the game (e.g.: -n 25)

Custom Constants

These constants are used to generate the utiliy values

Constant Default
EMPTY_LOCATION_REWARD -0.04
FOOD_REWARD 10
CAPSULE_REWARD 100
GHOST_REWARD -1000
GAMMA 0.9
DANGER_ZONE_RATIO 6
DANGER 500
ITERATIONS 10

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.