Skip to content

Commit 4c832aa

Browse files
committed
Sync with upstream 0.2.0 release
2 parents a6461ef + 4db1a7f commit 4c832aa

File tree

191 files changed

+5553
-487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+5553
-487
lines changed

.travis.yml

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,42 @@
1+
language: sh
2+
script: ./build.sh
3+
os:
4+
- linux
5+
- windows
6+
- osx
17
env:
2-
global:
3-
- REPO_DIR=.
4-
- BUILD_COMMIT=$TRAVIS_COMMIT
5-
- PLAT=x86_64
6-
7-
install:
8-
- git clone https://github.com/matthew-brett/multibuild && cd multibuild && git checkout 254ad28 && cd ..
9-
- . multibuild/common_utils.sh
10-
- . multibuild/travis_steps.sh
11-
- before_install
12-
- build_wheel $REPO_DIR $PLAT
13-
script:
14-
- install_run $PLAT
15-
16-
after_success:
17-
- ./deploy.sh
18-
19-
8+
- PY_VER=3.6
9+
- PY_VER=3.7
10+
- PY_VER=3.5
11+
osx_image: xcode8.3
2012
matrix:
21-
include:
13+
exclude:
14+
os: windows
15+
env: PY_VER=3.5
16+
deploy:
17+
provider: s3
18+
access_key_id: AKIAIR7X3BP26ZWUNFPA
19+
skip_cleanup: true
20+
secret_access_key:
21+
secure: wUNE0AxIZ3rQVO6pUXQyfOVI4UN/4bgTb+y8566pFYQ68mzZEW3XNl96n8HtkHGYuJGnNGWGbGKcp2a1MCoiyePR+NnmoUxCledUffU+s88Sxg9Qj7DW8JOLImocNXG+8y2OeC+QjmrkB109inM0c2T+ESeLZi9yALaLSxVEKToXB1EBDtOohjelNcA8xoP9yb4H6yoT01XLNkno2o9fmKc+ZXtLi9xZVpMX1aH0Hs2pchm0WmE7d93XVD0K9ZM/2q1yT8ojJngKAbpJeJQSSSJStNpFBIp7hc+2slFP9/QOCPJQZQuIjJkHj2iXEMgIrerbFgl/n5konQiZFHwDZbmubQR8cfVOmr/+By8n9h13rzL7OpqCx84f4QuaRifRY6vMnu0nqbo7M7vkW0fEzcMOEpn1fcL0ulOOFc9Oedyvn08flK2M3DX10rglncK+MkGdWjH23K/1PLNOCIdNO8kWO+yvuCbdx1oJzMcpr5w52Sh+pWt4xXk1TQvXtzPVxLxf+mGumHvU1wSFW2IbBcLIv3C/BeqeNbyRNIrXT2rfaOzDj8LEXOq3IIdfgKmHx2a4Iz3V3S2a5vJiXeBtr9G4LtH/k9eRRyr6CKN+HqSZSRnwL0W8i3u7QvcP6wSF91lJCpAJpsuu5faE3RKfW/hUd/gsmo1f1tcJZEaCkzo=
22+
bucket: games-wheels
23+
local-dir: wheelhouse
24+
upload-dir: atari-py/$TRAVIS_TAG
25+
acl: public_read
26+
on:
27+
repo: openai/atari-py
28+
tags: true
2229

23-
- os: linux
24-
env:
25-
- MB_PYTHON_VERSION=3.5
26-
27-
- os: linux
28-
env:
29-
- MB_PYTHON_VERSION=3.6
30-
31-
- os: linux
32-
env:
33-
- MB_PYTHON_VERSION=3.7
34-
35-
36-
- os: osx
37-
osx_image: xcode8.3
38-
env:
39-
- MB_PYTHON_VERSION=3.5
40-
- DEPLOY_SDIST=true
41-
42-
- os: osx
43-
osx_image: xcode8.3
44-
env:
45-
- MB_PYTHON_VERSION=3.6
46-
47-
- os: osx
48-
osx_image: xcode8.3
49-
env:
50-
- MB_PYTHON_VERSION=3.7
51-
52-
30+
jobs:
31+
# this extra stage is due to Travis bug that prevets deploying to pypi from windows or usage of
32+
# secret env variables on windows. Instead of doing either, we are deploying to s3 first, and
33+
# then using a separate stage to download files from s3 and deploy them to pypi.
34+
include:
35+
- stage: "Deploy to PyPI"
36+
script: ./deploy_to_pypi.sh
37+
env:
38+
- TWINE_USERNAME=peterz-openai
39+
- AWS_ACCESS_KEY_ID=AKIAIR7X3BP26ZWUNFPA
40+
- AWS_DEFAULT_REGION=us-west-2
41+
- secure: "i0qbR3wG2OvJWVBKnAVkgtNIPPxoNQz8KBn+c9RBAWZw0XDsjkUwsDZMTXzll1Do24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9C6azX4UaWuKPio8oxseOWfLKSYZTCVirBikLM8m4LABCZyKiMlTR1SdzxQmrLAxgnWaD+QYY4SoN4fButDjONOARFKF5e3njzVQo2nHmXb1EATOmnQ4pjKcJezSccIcmYeWpPskXWSmJbWi81zwHz/AyqH6fEnAWmVj0RKjrBfyCZCtEGBikQ9KTJuVHupwNT17CyZKUxtxBpYOpFnk+mLLom3Ak="

ChangeLog

Lines changed: 0 additions & 56 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 17 deletions
This file was deleted.

README-ale.md

Lines changed: 111 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,119 @@
1-
(Contents from [https://github.com/bbitmaster/ale_python_interface](https://github.com/bbitmaster/ale_python_interface))
1+
[![Build Status](https://travis-ci.org/mgbellemare/Arcade-Learning-Environment.svg?branch=master)](https://travis-ci.org/mgbellemare/Arcade-Learning-Environment)
22

33
<img align="right" src="doc/manual/figures/ale.gif" width=50>
44

5-
# Arcade-Learning-Environment
5+
# The Arcade Learning Environment
66

7-
The Arcade Learning Environment (ALE) -- a platform for AI research.
7+
The Arcade Learning Environment (ALE) is a simple object-oriented framework that allows researchers and hobbyists to develop AI agents for Atari 2600 games. It is built on top of the Atari 2600 emulator [Stella](https://stella-emu.github.io/) and separates the details of emulation from agent design. This [video](https://www.youtube.com/watch?v=nzUiEkasXZI) depicts over 50 games currently supported in the ALE.
88

9-
For more details and installation instructions, see the [website](http://www.arcadelearningenvironment.org) and [manual](doc/manual/manual.pdf). To ask questions and discuss, please join the [ALE-users group](https://groups.google.com/forum/#!forum/arcade-learning-environment).
9+
For an overview of our goals for the ALE read [The Arcade Learning Environment: An Evaluation Platform for General Agents](http://www.jair.org/papers/paper3912.html). If you use ALE in your research, we ask that you please cite this paper in reference to the environment (BibTeX entry at the end of this document). Also, if you have any questions or comments about the ALE, please contact us through our [mailing list](https://groups.google.com/forum/#!forum/arcade-learning-environment).
1010

11-
## Citing ALE
1211

13-
If ALE helps in your research, please cite the following:
12+
Feedback and suggestions are welcome and may be addressed to any active member of the ALE team.
1413

15-
@article{bellemare13arcade,
16-
author = {{Bellemare}, M.~G. and {Naddaf}, Y. and {Veness}, J. and {Bowling}, M.},
17-
title = {The Arcade Learning Environment: An Evaluation Platform for General Agents},
18-
journal = {Journal of Artificial Intelligence Research},
19-
year = "2013",
20-
month = "jun",
21-
volume = "47",
22-
pages = "253--279",
23-
}
14+
### Features
15+
- Object-oriented framework with support to add agents and games.
16+
- Emulation core uncoupled from rendering and sound generation modules for fast emulation with minimal library dependencies.
17+
- Automatic extraction of game score and end-of-game signal for more than 50 Atari 2600 games.
18+
- Multi-platform code (compiled and tested under OS X and several Linux distributions, with Cygwin support).
19+
- Communication between agents and emulation core can be accomplished through pipes, allowing for cross-language development (sample Java code included).
20+
- Python development is supported through ctypes.
21+
- Agents programmed in C++ have access to all features in the ALE.
22+
- Visualization tools.
23+
24+
## Quick start
25+
26+
27+
Install main dependences:
28+
```
29+
sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev cmake
30+
```
31+
32+
Compilation:
33+
34+
```
35+
$ mkdir build && cd build
36+
$ cmake -DUSE_SDL=ON -DUSE_RLGLUE=OFF -DBUILD_EXAMPLES=ON ..
37+
$ make -j 4
38+
```
39+
40+
To install python module:
41+
42+
```
43+
$ pip install .
44+
or
45+
$ pip install --user .
46+
```
47+
48+
Getting the ALE to work on Visual Studio requires a bit of extra wrangling. You may wish to use IslandMan93's [Visual Studio port of the ALE.](https://github.com/Islandman93/Arcade-Learning-Environment)
49+
50+
For more details and installation instructions, see the [manual](doc/manual/manual.pdf). To ask questions and discuss, please join the [ALE-users group](https://groups.google.com/forum/#!forum/arcade-learning-environment).
51+
52+
## ALE releases
53+
54+
Releases before v.0.5 are available for download in our previous [website](http://www.arcadelearningenvironment.org/). For the latest releases, please check our releases [page](https://github.com/mgbellemare/Arcade-Learning-Environment/releases).
55+
56+
## List of command-line parameters
57+
58+
Execute ./ale -help for more details; alternatively, see documentation
59+
available at http://www.arcadelearningenvironment.org.
60+
61+
```
62+
-random_seed [n] -- sets the random seed; defaults to the current time
63+
64+
-game_controller [fifo|fifo_named] -- specifies how agents interact
65+
with the ALE; see Java agent documentation for details
66+
67+
-config [file] -- specifies a configuration file, from which additional
68+
parameters are read
69+
70+
-run_length_encoding [false|true] -- determine whether run-length encoding is
71+
used to send data over pipes; irrelevant when an internal agent is
72+
being used
73+
74+
-max_num_frames_per_episode [n] -- sets the maximum number of frames per
75+
episode. Once this number is reached, a new episode will start. Currently
76+
implemented for all agents when using pipes (fifo/fifo_named)
77+
78+
-max_num_frames [n] -- sets the maximum number of frames (independent of how
79+
many episodes are played)
80+
```
81+
82+
83+
## Citing The Arcade Learning Environment
84+
85+
86+
If you use the ALE in your research, we ask that you please cite the following.
87+
88+
*M. G. Bellemare, Y. Naddaf, J. Veness and M. Bowling. The Arcade Learning Environment: An Evaluation Platform for General Agents, Journal of Artificial Intelligence Research, Volume 47, pages 253-279, 2013.*
89+
90+
In BibTeX format:
91+
92+
```
93+
@Article{bellemare13arcade,
94+
author = {{Bellemare}, M.~G. and {Naddaf}, Y. and {Veness}, J. and {Bowling}, M.},
95+
title = {The Arcade Learning Environment: An Evaluation Platform for General Agents},
96+
journal = {Journal of Artificial Intelligence Research},
97+
year = "2013",
98+
month = "jun",
99+
volume = "47",
100+
pages = "253--279",
101+
}
102+
```
103+
104+
105+
If you use the ALE with sticky actions (flag `repeat_action_probability`), or if you use the different game flavours (mode and difficulty switches), we ask you that you also cite the following:
106+
107+
*M. C. Machado, M. G. Bellemare, E. Talvitie, J. Veness, M. J. Hausknecht, M. Bowling. Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents, CoRR abs/1709.06009, 2017.*
108+
109+
In BibTex format:
110+
111+
```
112+
@Article{machado17arcade,
113+
author = {Marlos C. Machado and Marc G. Bellemare and Erik Talvitie and Joel Veness and Matthew J. Hausknecht and Michael Bowling},
114+
title = {Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents},
115+
journal = {CoRR},
116+
volume = {abs/1709.06009},
117+
year = {2017}
118+
}
119+
```

atari_py/ale_c_wrapper.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,25 @@ extern "C" {
2727
SYMBOL_EXPORT int act(ALEInterface *ale,int action){return ale->act((Action)action);}
2828
SYMBOL_EXPORT bool game_over(ALEInterface *ale){return ale->game_over();}
2929
SYMBOL_EXPORT void reset_game(ALEInterface *ale){ale->reset_game();}
30+
SYMBOL_EXPORT void getAvailableModes(ALEInterface *ale,int *availableModes) {
31+
ModeVect modes_vect = ale->getAvailableModes();
32+
for(unsigned int i = 0; i < ale->getAvailableModes().size(); i++){
33+
availableModes[i] = modes_vect[i];
34+
}
35+
}
36+
SYMBOL_EXPORT int getAvailableModesSize(ALEInterface *ale) {return ale->getAvailableModes().size();}
37+
SYMBOL_EXPORT void setMode(ALEInterface *ale, int mode) {ale->setMode(mode);}
38+
SYMBOL_EXPORT void getAvailableDifficulties(ALEInterface *ale,int *availableDifficulties) {
39+
DifficultyVect difficulties_vect = ale->getAvailableDifficulties();
40+
for(unsigned int i = 0; i < ale->getAvailableDifficulties().size(); i++){
41+
availableDifficulties[i] = difficulties_vect[i];
42+
}
43+
}
44+
SYMBOL_EXPORT int getAvailableDifficultiesSize(ALEInterface *ale) {return ale->getAvailableDifficulties().size();}
45+
SYMBOL_EXPORT void setDifficulty(ALEInterface *ale, int difficulty) {ale->setDifficulty(difficulty);}
3046
SYMBOL_EXPORT void getLegalActionSet(ALEInterface *ale,int *actions){
3147
ActionVect action_vect = ale->getLegalActionSet();
32-
for(unsigned int i = 0;i < ale->getLegalActionSet().size();i++){
48+
for(unsigned int i = 0; i < ale->getLegalActionSet().size(); i++){
3349
actions[i] = action_vect[i];
3450
}
3551
}
@@ -65,9 +81,10 @@ extern "C" {
6581
size_t screen_size = w*h;
6682
pixel_t *ale_screen_data = ale->getScreen().getArray();
6783

68-
ale->theOSystem->colourPalette().applyPaletteRGB(output_buffer, ale_screen_data, screen_size);
84+
ale->theOSystem->colourPalette().applyPaletteRGB(output_buffer, ale_screen_data, screen_size );
6985
}
7086

87+
7188
SYMBOL_EXPORT void getScreenRGB2(ALEInterface *ale, unsigned char *output_buffer){
7289
size_t w = ale->getScreen().width();
7390
size_t h = ale->getScreen().height();
@@ -83,6 +100,7 @@ extern "C" {
83100
}
84101
}
85102

103+
86104
SYMBOL_EXPORT void getScreenGrayscale(ALEInterface *ale, unsigned char *output_buffer){
87105
size_t w = ale->getScreen().width();
88106
size_t h = ale->getScreen().height();

0 commit comments

Comments
 (0)