Skip to content

Commit

Permalink
messed things up, repushing
Browse files Browse the repository at this point in the history
  • Loading branch information
sohamghosh121 committed Apr 20, 2018
0 parents commit 1ffdaf9
Show file tree
Hide file tree
Showing 68 changed files with 7,640 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
dist/
gym_pacman.egg-info
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# OpenAI Gym Berkeley-Pacman

Port of Berkeley AI Pacman to an OpenAI Gym environment.

The Berkeley Pacman AI engine is provided at http://ai.berkeley.edu/project_overview.html

## Info
This repository provides two environments:
* **BerkeleyPacman-v0**: which provides the Berkeley Pacman AI interface as is, with a randomly chosen layout. Layouts are in layouts/ folder
* **BerkeleyPacmanPO-v0**: which provides the Berkeley Pacman AI interface with only a partially observable portion of the map (immediate nearby locations in a 3x3 grid)

## Usage
To use these environments, do:
~~~~
import gym
import gym_pacman
env = gym.make('BerkeleyPacman-v0')
~~~~

Note: This was created for the 10-703 Project at Carnegie Mellon University. This is still under active development
1 change: 1 addition & 0 deletions gym_pacman/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.001
11 changes: 11 additions & 0 deletions gym_pacman/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from gym.envs.registration import register

register(
id='BerkeleyPacman-v0',
entry_point='gym_pacman.envs:PacmanEnv',
)

register(
id='BerkeleyPacmanPO-v0',
entry_point='gym_pacman.envs:PartiallyObservablePacmanEnv',
)
1 change: 1 addition & 0 deletions gym_pacman/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from gym_pacman.envs.pacman_env import PacmanEnv, PartiallyObservablePacmanEnv
73 changes: 73 additions & 0 deletions gym_pacman/envs/analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# analysis.py
# -----------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# Attribution Information: The Pacman AI projects were developed at UC Berkeley.
# The core projects and autograders were primarily created by John DeNero
# ([email protected]) and Dan Klein ([email protected]).
# Student side autograding was added by Brad Miller, Nick Hay, and
# Pieter Abbeel ([email protected]).


######################
# ANALYSIS QUESTIONS #
######################

# Set the given parameters to obtain the specified policies through
# value iteration.

def question2():
answerDiscount = 0.9
answerNoise = 0.2
return answerDiscount, answerNoise

def question3a():
answerDiscount = None
answerNoise = None
answerLivingReward = None
return answerDiscount, answerNoise, answerLivingReward
# If not possible, return 'NOT POSSIBLE'

def question3b():
answerDiscount = None
answerNoise = None
answerLivingReward = None
return answerDiscount, answerNoise, answerLivingReward
# If not possible, return 'NOT POSSIBLE'

def question3c():
answerDiscount = None
answerNoise = None
answerLivingReward = None
return answerDiscount, answerNoise, answerLivingReward
# If not possible, return 'NOT POSSIBLE'

def question3d():
answerDiscount = None
answerNoise = None
answerLivingReward = None
return answerDiscount, answerNoise, answerLivingReward
# If not possible, return 'NOT POSSIBLE'

def question3e():
answerDiscount = None
answerNoise = None
answerLivingReward = None
return answerDiscount, answerNoise, answerLivingReward
# If not possible, return 'NOT POSSIBLE'

def question6():
answerEpsilon = None
answerLearningRate = None
return answerEpsilon, answerLearningRate
# If not possible, return 'NOT POSSIBLE'

if __name__ == '__main__':
print 'Answers to analysis questions:'
import analysis
for q in [q for q in dir(analysis) if q.startswith('question')]:
response = getattr(analysis, q)()
print ' Question %s:\t%s' % (q, str(response))
Loading

0 comments on commit 1ffdaf9

Please sign in to comment.