-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1ffdaf9
Showing
68 changed files
with
7,640 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pyc | ||
dist/ | ||
gym_pacman.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v1.001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from gym_pacman.envs.pacman_env import PacmanEnv, PartiallyObservablePacmanEnv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
Oops, something went wrong.