Skip to content


Folders and files

Last commit message
Last commit date

Latest commit


Repository files navigation


CS 182 Artificial Intelligence Final Project

By Gabe Grand and Kevin Loughlin

Setup instructions for Mac

Our instructions assume that you have Python 2.7 and Homebrew installed on your machine. In order to use our system, you must download and install the OpenAI Gym, the FCEUX Nintendo Entertainment System emulator, and the Gym Super Mario environment. Then, open a bash shell, run the following commands.

pip install gym
pip install gym-pull
brew upgrade
brew install homebrew/games/fceux

Once this is completed, open a python shell and run the following.

import gym
import gym_pull

Assuming everything installs correctly, navigate to src/. You can set the hyperparameters as you wish in, and then run (which will launch the emulator and use our code for training). Finally, you can kill the processes via Control-C in the Python terminal, or running ./ in the src directory.

Source file breakdown

  • contains abstract class AbstractAgent for ensuring that all Q agents conform to the same methods.

  • contains class ApproxQAgent, which implements Approximate Q Learning algorithm. Inherits from AbstractAgent.

  • contains class ApproxSarsaAgent, which implements Approximate SARSA algorithm. Inherits from ApproxQAgent.

  • is a scrapwork file for testing feature functionality for approximation algorithms.

  • contains the feature functions used for approximation algorithms.

  • contains class HeuristicAgent, which implements the basline Heuristic Agent described in our report.

  • contains the hyperparameters set for testing, including number of iterations, level, agent type, and agent specific parameters.

  • contains class QLearningAgent, which implements Exact Q Learning algorithm. Inherits from AbstractAgent.

  • contains the classes RandomAgent and child WeightedRandomAgent, which implement the basline random agents described in our report.

  • contains the functions that handle different scenarios for the reward function.

  • contains the main method from which testing is run.

  • contains the self-implemented state class, as well as the distribution utility code available via John DeNero and Dan Klein's UC Berkeley AI materials. For more information, see

  • is used within to kill the FCEUX process.

  • can be used to start as a background process. It also kills and the FCEUX application when they are active.


Reinforcement learning for Super Mario Bros. in OpenAI Gym environment.






No releases published


No packages published