Commit Graph

1491 Commits

Author SHA1 Message Date
Kristian Holsheimer
074bc269b5 Rewrite LazyFrames.__getitem__ to only decompress if needed (#1906)
* add last_frame property to LazyFrames

* drop LazyFrames.last_frame and rewrite __getitem__ instead
2020-06-05 15:01:04 -07:00
InstanceLabs
d8908cbf10 Get rid of class variables in algorithmic env. (#1910)
Make reward_shortfalls and min_length instance variables.
Fixes the TODO in algorithmic_env.py.

Co-authored-by: pzhokhov <peterz@openai.com>
2020-05-29 14:23:44 -07:00
Jonathan J Hunt
821841c1a1 Lazily seed np rng (#1913)
* Lazily seed np rng

* Fix missing return in np random
2020-05-29 14:11:39 -07:00
Shashi Kant
0f513ac839 pyglet GL context for SimpleImageViewer case (#1916)
* pyglet GL context for SimpleImageViewer case

* typo fxd 'viewer_type' argument in get_window()

* use **kwargs in get_window()

* remove viewer_type from Viewer class
2020-05-29 14:09:38 -07:00
Kavish Hukmani
612bf41c5a Added RubiksCubeGym (#1930) 2020-05-29 14:08:01 -07:00
Pierluigi Urru
6fd99ba8ba Change tabs into spaces (#1932)
Tabs were mixed up with spaces, resulting in the file being weirdly formatted in editors were tabs are not rendered with 4 spaces (e.g. GitHub https://github.com/openai/gym/edit/master/gym/envs/classic_control/mountain_car.py)
2020-05-29 14:02:22 -07:00
InstanceLabs
2ec4881c22 Improve algorithmic environments. (#1909)
Improve legibility and adhere to PEP-8.
2020-05-15 14:41:59 -07:00
mloo3
601548dbc5 Fix robot.xml spelling mistake (#1908) 2020-05-15 14:39:07 -07:00
Revanthmk
8549613b2b Description for mountain_car.py (#1904)
Added description for the mountain_car environment. As a beginner this description would have saved a lot of time for me for understanding the environment.
2020-05-15 14:21:11 -07:00
hardmaru
d173fd2c65 fixed close() method for Viewer to be consistent with SimpleImageViewer() (#1912)
fixed close() method for Viewer to be consistent with SimpleImageViewer(), otherwise I get the same error:

```
Exception ignored in: <bound method Viewer.__del__ of <gym.envs.classic_control.rendering.Viewer object at 0x112ea2f60>>
Traceback (most recent call last):
  File "/Users/hadavid/anaconda/lib/python3.6/site-packages/gym/envs/classic_control/rendering.py", line 162, in __del__
  File "/Users/hadavid/anaconda/lib/python3.6/site-packages/gym/envs/classic_control/rendering.py", line 81, in close
  File "/Users/hadavid/anaconda/lib/python3.6/site-packages/pyglet/window/cocoa/__init__.py", line 277, in close
  File "/Users/hadavid/anaconda/lib/python3.6/site-packages/pyglet/window/__init__.py", line 820, in close
ImportError: sys.meta_path is None, Python is likely shutting down
```
2020-05-15 14:14:56 -07:00
Peter Zhokhov
b2727d6fd3 0.17.2 and release notes 2020-05-08 16:25:27 -07:00
Zach Dwiel
174a27b7fc Allow Box more flexibility in how shape is provided (#1873)
The current implementation of Box doesn't allow passing an array as low or high while also providing a shape.
The current implementation of Box doesn't allow passing an array as low or high and a constant as the other bound.

Co-authored-by: pzhokhov <peterz@openai.com>
2020-05-08 14:56:14 -07:00
Shashi Kant
dfbfab6237 fix "Could not create GL context" (#1889)
* fix "Could not create GL context"

* get available display in case of None spec - create context all the time
2020-05-08 14:39:38 -07:00
troiganto
a8d08c041d Improve observation space of FlattenObservation wrapper (#1884)
* Add tests for gym.spaces.utils.

* Add docstrings to gym.spaces.utils.

* Remove some trailing whitespace.

* Add gym.spaces.utils.flatten_space.

The new function also is reexported as gym.spaces.flatten_space. It
improves the determination of observation_space in
gym.wrappers.FlattenObservation.

* Produce OrderedDict instead of dict in gym.spaces.unflatten().

`gym.spaces.Dict` is very particular about producing its samples as
`OrderedDict` in order preserve the order of its items. Hence,
`unflatten()` should reproduce this behavior.

* In test_utils.compare_nested, also verify order of OrderedDict items.

* Add examples to flatten_space() docstring.

* Document ``flatten(space, space.sample()) in flatten_space(space)``.

Co-authored-by: Nico Madysa <nico.madysa@tu-dresden.de>
2020-05-08 14:19:55 -07:00
InstanceLabs
819f25c0e2 Clean up cartpole environment. (#1875)
Co-authored-by: Peter Zhokhov <peterz@openai.com>
2020-05-08 13:03:48 -07:00
Peter Zhokhov
2c53496e2c re-enable mujoco tests 2020-04-24 18:28:23 -05:00
Peter Zhokhov
53a5c4fddd disable mujoco temporarily 2020-04-24 18:10:14 -05:00
johannespitz
c6f275f4fb Avoid precision warning when creating gym.spaces.box with scalar bounds (#1878) 2020-04-24 17:24:35 -05:00
Christopher Hesse
76c33bd948 add modelica environment 2020-04-24 15:01:33 -07:00
InstanceLabs
9e9bb2830f Clean up pendulum environment. (#1877) 2020-04-24 16:56:04 -05:00
Diego Ferigo
10f3ffe680 Update stored spec object with kwargs (#1866)
* Update stored spec object with kwargs

* Add unit test
2020-04-24 16:49:41 -05:00
Jianyu Chen
a75cb47be2 add gym-carla to third-party environment list (#1861) 2020-04-24 16:48:43 -05:00
Rui
477aa1c277 made fetchenv sample goal flexible (#1799) 2020-04-24 16:34:39 -05:00
Dan Timbrell
3bd5ef71c2 Clean some docstrings (#1854)
* add type of argument

* fix typos

* split lines for formatting

* reformat string, add ellipsis, remove r string

* make docstring stylistically consistent

* make docstrings a little more elaboratet

* reduce by 1 space

* make line wrap 120

* remove unnecessary line

* add returns to docstring

* add docstring, make code more pep8 and delete some unused print functions

* more pep8

* file docstring instead of comments

* delete unused variables, add file docstring and add some pep8 spring cleaning

* add file docstring, fix typos and add some pep8 correections

Co-authored-by: Dan <daniel.timbrell@ing.com>
2020-04-24 16:10:27 -05:00
Colin Vandenhof
f2c9793eb7 Update atari_preprocessing.py (#1790)
Correct bug that prevents AtariPreprocessing from working with frame_skip = 1.
2020-04-17 17:13:06 -05:00
Fabian Schläpfer
a6bbc269cf Use action space bounds in continuous mountain car environment (#1869) 2020-04-10 17:27:28 -05:00
InstanceLabs
7b41b884f2 Clean up continuous mountain car environment (#1867)
* Clean up continuous mountain car

* Convert possible numpy bool to Python bool.
2020-04-10 17:25:01 -05:00
pzhokhov
f4b70286be add nas-env to third party environments (#1794)
Co-authored-by: peterz <peterz@peterzs-MacBook-Pro.local>
2020-04-10 17:11:38 -05:00
pzhokhov
67212547ac remove six and __future__ imports (#1840)
* remove six

* remove __future__ imports

* remove six from setup.py, python 2.7 from README.rst
2020-04-10 17:10:34 -05:00
johannespitz
a8a3d36353 Add shape property and equality operation to LazyFrames (#1862)
* Add shape property and equality operation to LazyFrames for simplified usage in tests

* Fix shape property with lz4_compress
2020-04-10 17:10:10 -05:00
Miguel Martínez
9a7f13911c Make reward always return a float number (#1857)
In the current implementation, *reward* sometimes returns integer values, and other times returns float values.

The example below corresponds to three random episodes and showcases how reward contains -1.0 and -1 values.
    [((13, 1, False), 0, -1.0)]
    [((18, 10, False), 1, -1)]
    [((5, 10, False), 1, 0), ((8, 10, False), 1, 0), ((18, 10, False), 1, 0), ((20, 10, False), 0, -1.0)]

This change tries to fix that, and guarantee that a float value is always returned.

Hope it helps!
Miguel
2020-04-10 16:43:15 -05:00
sorryformyself
54f22cf4db Update the docstring in envs/toy_text/blackjack.py (#1829)
* Update blackjack.py

* Update blackjack.py

Co-authored-by: pzhokhov <peterzhokhoff@gmail.com>
2020-03-22 15:54:54 -05:00
Yusuke Nakata
c0860592f5 remove unused lines (#1787) 2020-03-06 17:28:23 -05:00
Edouard Leurent
1c710ff03b Add highway-env to third party environments in environments.md (#1839)
[highway-env](https://github.com/eleurent/highway-env) is a simulated
driving environment for high-level decision-making.

Co-authored-by: pzhokhov <peterz@openai.com>
2020-03-06 17:03:10 -05:00
Alexis DUBURCQ
d67f4ca0e8 Add gym-jiminy in the third-party environments doc (#1835)
I have developed a new open source simulator for poly-articulated system called Jiminy. It relies on the powerful rigid body dynamics framework Pinocchio for the physics evaluation, and meshcat for real-time visualization.
I think the project is now mature enough for everyone to use it, despite being partially undocumented. The library has been designed for fast prototyping of control algorithms and machine learning. It is easy to use and several examples of classical control theory and machine learning are available (cartpole, double and simple pendulums).
2020-03-06 16:51:15 -05:00
Christian Clauss
b7bd6bd1cc Typo: enviroment --> environment (#1828)
* Typo: enviroment --> environment

* Typo: information does not have a plural form in English
2020-03-06 16:37:23 -05:00
pzhokhov
743a2d5eac expand cloudpickle range (#1836)
* expand cloudpickle range

* 0.17.1 release note
2020-03-05 10:49:52 -05:00
pzhokhov
c476e8553f fix python_requires in setup.py (#1827) 2020-02-29 02:39:04 +01:00
Xingdong Zuo
a14e1c7292 Fix unnecessary warnings (#1800)
* Update pendulum.py

* Update continuous_mountain_car.py

* Update cartpole.py

* Update mujoco_env.py

* Update mountain_car.py

* Update acrobot.py
2020-02-29 01:11:29 +01:00
Edouard Leurent
242eb2ac2c Video recorder: distinguish input and output fps (#1817)
* Video recorder: distinguish input and output fps

Common video players such as VLC, or Quicktime struggle to play videos
with low framerate, which is problematic for environments where the
policy
frequency is low (e.g. 1 Hz).
See: https://superuser.com/a/601916

This commit sets:
- The input image sequence framerate to the metadata
'video.frames_per_second'
- The output video framerate to at least 30 fps

* Use a configurable output video framerate

This output video framerate is different from the image sequence
framerate:
- when the environment fps is low, the output video fps can be increased
so that players like VLC or Quicktime handle them more gracefully (they
struggle at low fps)
- when the environment fps is very high, the output video can still be
recorded at a lower fps to better compression.

It is configured through the 'video.output_frames_per_second' metadata
and defaults to 'video.frames_per_second' (which itself defaults to 30)
2020-02-29 01:05:18 +01:00
marload
72a400a594 fix: Invalud argument format (#1822) 2020-02-29 00:55:13 +01:00
tvalentyn
16112ad72f Pick up a newer version of Cloudpickle, which fixes https://github.com/cloudpipe/cloudpickle/issues/82 (#1816) 2020-02-26 17:33:01 +01:00
pzhokhov
639264c545 Drop python2 support (#1819)
* drop python 2 support

* remove python 2.7 logic from Dockerfile

* Revert "remove python 2.7 logic from Dockerfile"

This reverts commit 43ceabfa8d70ca083661ab3d0d03f2a1adbef5ff.

* remove python 2.7 logic from Dockerfile

* use python 3.7.3 (3.7.6 segfaults with mujoco for some reason?

* include cmake into system level packages

* add swig to system packages

* python3.8 build still segfaults on mujoco tests, disabling for now

* add python 3.8 and 3.9 to the build

* python 3.9.1 -> 3.9.0

* oops i did not realize python 3.9 is still in alpha
2020-02-25 14:11:55 +01:00
Dhruv
b72501dd02 Update README.md (#1815)
Added italics to some important words in sentence to enhance readability(I missed them but those words shouldn't be missed).
Added comma wherever necessary.
2020-02-21 15:47:49 +01:00
Peter Zhokhov
4ca60758b4 v0.16.0 release notes and version bump 2020-02-10 11:09:11 +01:00
Peter Zhokhov
4d24886f20 0.15.6 release notes 2020-02-03 11:42:33 +01:00
pzhokhov
eeb1f97d38 pyglet 1.4 compatibility (#1771)
* pyglet 1.4 compatibility

* change pyglet version in setup.py
2020-02-03 11:34:28 +01:00
Alex P-B
2d247dc93a Fix BipedalWalker - now returns closest lidar trace instead of furthest (#1789)
* Fix BipedalWalker - now returns closest lidar trace instead of furthest

* additional fix for raycast failing to get nearest point

* bump bipedal walker versions from v2 to v3
2020-01-31 05:02:05 -08:00
Priyanka Subramanyam
68c3f0ec9c Add usage for MultiBinary space (#1791)
* Add usage for MultiBinary space

* Add multibinary observation space example usage and sample
2020-01-24 21:42:41 -08:00
Peter Zhokhov
bae3e9e832 0.15.5 release notes 2020-01-24 14:53:34 -08:00