Commit Graph

37 Commits

Author SHA1 Message Date
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
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
Benedikt S. Vogler
679f1a7aba Pole balancing documentation of observation matches code (#1914)
* documentation matches code

The returned angle is returned in the unit of radians and not degrees.

* use tabs for indent
2020-06-19 15:18:19 -07:00
Raphael Van Hofffelen
65ae8f8f6b changed "reward" to the correct term "return" (#1946) 2020-06-12 14:14:35 -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
819f25c0e2 Clean up cartpole environment. (#1875)
Co-authored-by: Peter Zhokhov <peterz@openai.com>
2020-05-08 13:03:48 -07: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
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
Benjamin Danek
57187307f1 Update cartpole.py (#1263) 2019-02-08 16:45:48 -08:00
pzhokhov
07e0c98f8e python27 tests (#1314)
* add py27 test environment (sans box2d and atari)

* skip mujoco tests if mujoco_py not present

* re-enable python3 tests

* remove unicode symbols

* remove more unicode symbols
2019-02-08 11:46:51 -08:00
Charles Packer
094e6b8e6a CartPole/Acrobot rendering fix (#1189)
* Fixed rendering to properly display modifications to length etc

* 'self.length is half the pole's length'

* Explicitly base viewer size on Acrobot link size

* Made correct polygon rendering work for different link lengths
2018-10-18 14:30:18 -07:00
Alex
42f9e14c00 Updated Calculation Order (#1019)
* Updated order Calculation

Updated order of `x` and `theta` calculations so that they are no longer one timestamp behind `x_dot` and `theta_dot`.

https://github.com/openai/gym/issues/1018

* Added semi-implicit euler option

* Got implicit and standard euler mixed up

* switched default option
2018-09-21 15:19:40 -07:00
Madhavun
3ff851fe21 Added explicit dtype to observation_space (#1084)
To suppress warning coming from line 31 of spaces.Box
2018-09-17 10:28:02 -07:00
cfperez
243226bee0 Fix env.close() to allow re-opening window (#1155) 2018-09-14 13:36:57 -07:00
pzhokhov
4fada72689 Update cartpole.py 2018-09-14 13:35:08 -07:00
Chris Miles
75f28faf9b Update docstrings of environment classes (#1123)
* update reference to Sutton and Barto in docstring of CliffWalkingEnv class

* update reference to Sutton and Barto in docstring of BlackjackEnv class

* added detailed description of taxi environment in doc string

* Fixed typo. I swapped north and south in actions list

* placed wiki description of cartpole to a docstring

* fixed formatting in docstring

* fixed formating in docstring
2018-08-24 16:30:17 -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
Sam Stites
92a17bdea2 Update links to Sutton's new homepage (perma where possible) (#577) 2017-06-14 13:27:42 -07:00
Trevor Blackwell
8c6468b34d Don't crash if render called before reset 2017-02-27 10:00:48 -08:00
John Schulman
a67653ccb1 cartpole fix (#457)
minor fixes related to configure() and cartpole
2017-01-03 23:19:14 -08:00
Rafael Cosman
1e86e73919 fixes cartpole observation_space (#210) 2016-06-20 13:42:06 -07:00
Jie Tang
8a545eeb59 Tighten assertions (#197) 2016-06-16 00:12:47 -07:00
Greg Brockman
2aa03d6088 Add configure method to Env, and support multiple displays in CartPole (#175)
* Add configure method to Env, and support multiple displays in CartPole

This allows people to pass runtime specification which doesn't affect
the environment semantics to environments created via `make`.

Also include an example of setting the display used for CartPole

* Provide full configure method

* Allow environments to require configuration

* Don't take arguments in make
2016-06-12 20:56:21 -07:00
Jie Tang
7605986f09 Push up x_threshold to silence warnings: fixes #88 2016-06-09 16:22:15 -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
Greg Brockman
2ae0dbc846 Discard viewer object after render with close=True
Fixes #95
2016-05-15 17:22:38 -07:00
JKCooper2
d2d940bddb Cartpole observations can occur outside of observation space limits - Issue #88 (#89)
* Set restriction on selected actions

* Used self.action_space instead of custom set

* Move action validation to core.py

* Fix for Cartpole observations outside of observation_space
2016-05-11 14:50:35 +02:00
Josh Marlow
7908761a60 Removed legacy super() rendering calls (#78) 2016-05-09 18:06:48 -07:00
Josh Marlow
9529fa731b Replaced is string comparison with == (#77) 2016-05-09 17:51:04 -07:00
Sherjil Ozair
fc3c4e576a Fix warning being raised incorrectly 2016-04-29 02:12:46 -07:00
Greg Brockman
ec92067852 cartpole.py: Make more friendly to beginners without changing official behavior 2016-04-28 22:34:10 -07:00
Greg Brockman
e8f2980603 Initial release. Hello world :). 2016-04-27 08:00:58 -07:00