Commit Graph

36 Commits

Author SHA1 Message Date
trigaten
b9e8b6c587 Reformat some docstrings, remove unneeded image links (#2578)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

* put docstrings in base environments rather than highest version

* fix richer reacher

* black

* correct black version

* continuous mountain car docstring to markdown

* remove unneeded images

* black

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-27 15:36:50 -05:00
trigaten
a149869bcb docs+credits (#2574)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-26 16:02:42 -05:00
Ariel Kwiatkowski
925823661d Add options to the signature of env.reset (#2515)
* First find/replace, now tests

* Fixes to the vector env

* Make seed keyword only in wrappers

* (try to) fix the bug with old environments using new wrappers (with the seed keyword)

* black

* Change **kwargs to options, try to make it work; black

* Add OrderEnforcing wrapper to wrapper exports
Add a test for compatibility with old (pybullet-like) envs

* Add OrderEnforcing wrapper to wrapper exports
Add a test for compatibility with old (pybullet-like) envs
black

* Update the env checker

* Update the env checker

* Update the env checker to use inspect (might fail tests, let's see)

* Allow the signature to include kwargs in env_checker

* Minor fix
2022-01-19 17:28:59 -05:00
Carlos Luis
8a96440084 Move rendering.py to utils (#2551)
* Move rendering.py to utils

* Rename rendering.py to pyglet_rendering.py
2022-01-06 13:01:29 -05:00
Andrew Tan Jin Shen
4fe7efaacd Consolidate LunarLander and BipedalWalker envs (#2522)
* Consolidate LunarLander and BipedalWalker envs

* Update LunarLander tests

* Add type hints

* Add detailed error message on instantiating deprecated environments

* Fix formatting with black pre-commit

Co-authored-by: Andrew Tan Jin Shen <andrew.tanjs@shopee.com>
2021-12-22 13:25:07 -05:00
Ariel Kwiatkowski
c364506710 Seeding update (#2422)
* Ditch most of the seeding.py and replace np_random with the numpy default_rng. Let's see if tests pass

* Updated a bunch of RNG calls from the RandomState API to Generator API

* black; didn't expect that, did ya?

* Undo a typo

* blaaack

* More typo fixes

* Fixed setting/getting state in multidiscrete spaces

* Fix typo, fix a test to work with the new sampling

* Correctly (?) pass the randomly generated seed if np_random is called with None as seed

* Convert the Discrete sample to a python int (as opposed to np.int64)

* Remove some redundant imports

* First version of the compatibility layer for old-style RNG. Mainly to trigger tests.

* Removed redundant f-strings

* Style fixes, removing unused imports

* Try to make tests pass by removing atari from the dockerfile

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* First attempt at deprecating `env.seed` and supporting `env.reset(seed=seed)` instead. Tests should hopefully pass but throw up a million warnings.

* black; didn't expect that, didya?

* Rename the reset parameter in VecEnvs back to `seed`

* Updated tests to use the new seeding method

* Removed a bunch of old `seed` calls.

Fixed a bug in AsyncVectorEnv

* Stop Discrete envs from doing part of the setup (and using the randomness) in init (as opposed to reset)

* Add explicit seed to wrappers reset

* Remove an accidental return

* Re-add some legacy functions with a warning.

* Use deprecation instead of regular warnings for the newly deprecated methods/functions
2021-12-08 16:14:15 -05:00
Elijah K
eec6167440 Py36+ syntax in gym/envs: derived by running pyupgrade --py36-plus gym/envs/**.py and flynt gym --ll 120 (#2465)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-13 19:53:32 -05:00
Ahmed Omar
2754d9737e removed calls to reset from init (#2394)
* removed all calls to reset

* passing tests

* fix off-by-one error

* revert

* merge master into branch

* add OrderEnforcing Wrapper

* add orderenforcing to the docs

* add option for disabling

* add argument to EnvSpec
2021-09-16 10:16:49 -04:00
J K Terry
78d2b512d8 redo black (#2272) 2021-07-29 15:39:42 -04:00
Justin Terry
e9d2c41f2b redo black 2021-07-29 12:42:48 -04:00
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
miluChen
9a9e68a888 close env after done (#2162)
* close env after done

* fix if

Co-authored-by: He Chen <hchen584@bloomberg.net>
Co-authored-by: J K Terry <justinkterry@gmail.com>
2021-07-26 15:49:56 -04: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
Tautvydas Misiunas
c593041c9f Update LunarLander description. (#996)
Update description to include side engine cost.
2019-02-25 17:05:35 -07:00
R. Miles McCain
49cd48020f Small typo fix in Lunar Lander (#1222) 2018-11-28 17:28:31 -08:00
Josh Achiam
769c8a75d1 Makes Box2D environments pickleable. (#1177) 2018-09-24 13:16:46 -07:00
pzhokhov
e54db8e07a lunarlander add rendering back to test_lunar_lander.py (#1146)
* adding lunar lander tests

* added tests for lunar lander

* restored lunar_lander to master branch

* merged Oleg's fix

* removed rendering, fixed seed to 0)

* added rendering back to lunar_lander

* move enjoy_lander into lunar_lander.py

* fixed version of the lunar lander env in the description

* rename enjoy_lander -> demo_heuristic_lander
2018-08-28 14:12:10 -07:00
Luc Coupal
608cb3f639 fix to state variable pos.y (#1137)
Am I mistaken or it's a typo ... VIEWPORT_H vs VIEWPORT_W
2018-08-27 14:24:38 -07:00
pzhokhov
c15d44aa38 tests for lunarlander (#1143)
* adding lunar lander tests

* added tests for lunar lander

* restored lunar_lander to master branch

* merged Oleg's fix

* removed rendering, fixed seed to 0)
2018-08-27 14:24:05 -07:00
Oleg Klimov
962874329c LunarLander: fix to previous fix (#1127) 2018-08-27 11:22:29 -07:00
Oleg Klimov
d1146303b0 LunarLander: use dtype for Boxes, replace assert with clip (#1060) 2018-08-14 17:30:40 -07:00
John Schulman
4c460ba6c8 Cleanup, removal of unmaintained code (#836)
* add dtype to Box

* remove board_game, debugging, safety, parameter_tuning environments

* massive set of breaking changes
- remove python logging module
- _step, _reset, _seed, _close => non underscored method
- remove benchmark and scoring folder

* Improve render("human"), now resizable, closable window.

* get rid of default step and reset in wrappers, so it doesn’t silently fail for people with underscore methods

* CubeCrash unit test environment

* followup fixes

* MemorizeDigits unit test envrionment

* refactored spaces a bit
fixed indentation
disabled test_env_semantics

* fix unit tests

* fixes

* CubeCrash, MemorizeDigits tested

* gym backwards compatibility patch

* gym backwards compatibility, followup fixes

* changelist, add spaces to main namespaces

* undo_logger_setup for backwards compat

* remove configuration.py
2018-01-25 18:20:14 -08:00
Oleg Klimov
ee2c0243c0 LunarLanderContinuous (#307)
* New LunarLanderContinuous, LunarLander-v2 remains exactly the same, no version bump.

* keyboard_agent.py works again.
2016-08-24 16:08:32 -07:00
Matt Harvey
92d5c9458a Move _reset() in constructor to below the definitions of action_space (#220) 2016-06-20 00:38:25 +02:00
Jie Tang
36d476224e Assert is a keyword, not a function 2016-06-16 01:17:37 -07:00
Jie Tang
8a545eeb59 Tighten assertions (#197) 2016-06-16 00:12:47 -07:00
Oleg Klimov
af5bb400fe trivial fix for #143 (#187)
* trivial fix for #143

* #143 same fix for other environments, not really necessary, but still
2016-06-14 08:32:51 -07:00
Oleg Klimov
72d89cb22f Faster video recording (#119)
* Faster video recording

* rendering.py: return_rgb_array default to False, for other environments not to break
2016-06-06 00:06:26 -07:00
Greg Brockman
8a535ca6f2 Switch to a global PRNG for action/observation spaces (#144)
cf 58e6aa95e5 (commitcomment-17669277)
2016-05-30 18:07:59 -07:00
Greg Brockman
58e6aa95e5 [WIP] add support for seeding environments (#135)
* Make environments seedable

* Fix monitor bugs

- Set monitor_id before setting the infix. This was a bug that would yield incorrect results with multiple monitors.
- Remove extra pid from stats recorder filename. This should be purely cosmetic.

* Start uploading seeds in episode_batch

* Fix _bigint_from_bytes for python3

* Set seed explicitly in random_agent

* Pass through seed argument

* Also pass through random state to spaces

* Pass random state into the observation/action spaces

* Make all _seed methods return the list of used seeds

* Switch over to np.random where possible

* Start hashing seeds, and also seed doom engine

* Fixup seeding determinism in many cases

* Seed before loading the ROM

* Make seeding more Python3 friendly

* Make the MuJoCo skipping a bit more forgiving

* Remove debugging PDB calls

* Make setInt argument into raw bytes

* Validate and upload seeds

* Skip box2d

* Make seeds smaller, and change representation of seeds in upload

* Handle long seeds

* Fix RandomAgent example to be deterministic

* Handle integer types correctly in Python2 and Python3

* Try caching pip

* Try adding swap

* Add df and free calls

* Bump swap

* Bump swap size

* Try setting overcommit

* Try other sysctls

* Try fixing overcommit

* Try just setting overcommit_memory=1

* Add explanatory comment

* Add what's new section to readme

* BUG: Mark ElevatorAction-ram-v0 as non-deterministic for now

* Document seed

* Move nondetermistic check into spec
2016-05-29 09:07:09 -07:00
Oleg Klimov
b867be4001 LunarLander, BipedalWalker now count energy spent 2016-05-26 11:44:29 -07:00
Oleg Klimov
17dd787c0b Fix for #114 (#118) 2016-05-25 01:16:15 -07:00
Oleg Klimov
c2587d2bb7 BipedalWalker, LunarLander heuristic, retuned (#101)
* bipedal_walker: trivial fixes

* lunar_lander: heuristic test code, renormalized and tested reward, longer state vector

* bipedal_walker: heuristic test code, renormalized and tested reward, legs contact with ground in state vector

* bipedal_walker: description text
2016-05-16 07:12:44 -07:00
Greg Brockman
2ae0dbc846 Discard viewer object after render with close=True
Fixes #95
2016-05-15 17:22:38 -07:00
Jonas Schneider
6bb2d56266 Minor Python3 compat fixes 2016-05-10 17:05:47 +02:00
Oleg Klimov
3b19acdfce Box2d initial, second attempt 2016-05-03 22:27:42 +03:00