Commit Graph

26 Commits

Author SHA1 Message Date
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
Ariel Kwiatkowski
d7023500f3 Fix dtypes to be consistent with observation_space (#2340)
* Changed the dtypes of classic control envs to float32

* Fixed formatting via black

* Added dtype tests

* Formatting, and test error message

* Only test dtypes for Box space

* Fix Bipedal Walker and Car Racing

* Undo the car racing dtype change

* Redo the car racing dtype change - set to np.float32, and updated observation_space to reflect it
2021-08-21 18:11:19 -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
Vasco CC
8f6eb1ebd0 BUG FIX: Bipedal Walker; Car Racing; Guessing Game; Hotter Colder - Showing Warning (#2126)
* Fixing Warning issue

Fixing an issue causing a Warning message to pop because of conversion from python standard float64 to np.float32

* car_racing.py Warning Fix

Fixed a bug generating a warning with conversion from standard `float 64` to `numpy float 32`.

* Fixing Warning issue 

Fixed a bug generating a warning with conversion from standard `float 64` to `numpy float 32`.

* Fixing Warning issue

Fixed a bug generating a warning with conversion from standard `float 64` to `numpy float 32`.

* bracket missing

* Bracket misplaced
2021-07-26 15:39:04 -04: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
Antonin RAFFIN
cdd212db4b Fix autodetect dtype warnings (#1234)
* Fix autodetect dtype warnings

* Use warnings module for gym logger

* Fix warning in tests
2018-11-28 17:27:27 -08:00
Josh Achiam
769c8a75d1 Makes Box2D environments pickleable. (#1177) 2018-09-24 13:16:46 -07:00
Rui Wang
293eea787a fix 2018-04-13 13:12:06 -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
Jie Tang
36d476224e Assert is a keyword, not a function 2016-06-16 01:17:37 -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
Oleg Klimov
ba9fd3435e bipedal_walker: trivial fixes (#93) 2016-05-12 07:06:04 -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