Commit Graph

50 Commits

Author SHA1 Message Date
John Schulman
1a06fe0d9b get rid of auto reset 2017-01-03 23:51:25 -08:00
John Schulman
a67653ccb1 cartpole fix (#457)
minor fixes related to configure() and cartpole
2017-01-03 23:19:14 -08:00
Tom Brown
69c1cda01c Downgrade DoubleWrap error to warning 2016-12-28 13:08:47 -08:00
Tom Brown
85da4b7877 Improve error message 2016-12-28 13:08:47 -08:00
Jie Tang
a81a631b2e Add error when wrapping after configure 2016-12-28 13:08:47 -08:00
Tom Brown
3ad93f62fd Improve deprecation message 2016-12-27 20:02:33 -08:00
Tom Brown
2d44ed4968 Add Monitored wrapper (#434)
* Add WIP Monitored wrapper

* Remove irrelevant render after close monitor test

* py27 compatibility

* Fix test_benchmark

* Move Monitored out of wrappers __init__

* Turn Monitored into a function that returns a Monitor class

* Fix monitor tests

* Remove deprecated test

* Remove deprecated utility

* Prevent duplicate wrapping, add test

* Fix test

* close env in tests to prevent writing to nonexistent file

* Disable semisuper tests

* typo

* Fix failing spec

* Fix monitoring on semisuper tasks

* Allow disabling of duplicate check

* Rename MonitorManager

* Monitored -> Monitor

* Clean up comments

* Remove cruft
2016-12-23 16:21:42 -08:00
Greg Brockman
faed1c6546 Get rid of separate async semantics 2016-11-13 19:42:57 -08:00
Greg Brockman
b7e53c371d Update ObservationWrapper for new async semantics 2016-11-07 14:30:06 -08:00
damodei
5afbb71929 add reverse action filter for demos 2016-10-14 22:07:47 -07:00
Greg Brockman
3c95d3af8f Clear default metadata in Wrapper
Closes #340
2016-09-09 10:13:53 -07:00
Greg Brockman
0278f273fa Revert wrappers to having their own monitor
Otherwise you end up with multiple calls to the same monitor at each
step.
2016-09-05 16:00:31 -07:00
Greg Brockman
a6ec54415c By default, Wrappers shouldn't have their own monitors 2016-09-05 10:30:54 -07:00
Greg Brockman
9b8472726c Check for hasattr _monitor before invoking monitor 2016-09-04 19:41:11 -07:00
Greg Brockman
6c6bd391a5 Add non-underscore methods for Wrappers 2016-09-04 01:44:20 -07:00
Greg Brockman
f30ff469b8 [WIP] Start adding Filter API (#329)
Expand Wrapper API
2016-09-04 00:38:03 -07:00
Olivier Sigaud
c97551e8e5 added continuous mountain car v0 (#306)
* added continuous mountain car v0

* spotted that the action should be a vector, not a scalar

* fixed bug on action format

* bug fixed in scoreboard registering

* the observation (aka state) should be a numpy array

* added comment on reward range as requested
2016-08-24 14:10:58 -07:00
Greg Brockman
e2c9e84a51 Bump version 2016-08-17 15:55:14 -07:00
Greg Brockman
ee02589eec Don't have envs be aware of wrappers (#296)
You can always achive the same effect by exposing a wrapping function:

def MyEnv():
  return MyWrapper(MyUnwrappedEnv())
2016-08-17 15:16:45 -07:00
Greg Brockman
40fc7d57ce Have env.close also close the monitor and any open windows 2016-08-17 13:59:35 -07:00
Greg Brockman
09082c9e5c Tweak Wrapper implementation (#291)
* Tweak README and don't use __new__ for wrapper

The extra 'env' argument means that Wrapper authors with a custom
__init__ need to think about the parent signature anyway, so there's
not as much benefit to adding the more surprising __new__.

* Add support for registering wrappers for the official environment
2016-08-13 19:24:48 -07:00
Philip Paquette
f4ae35ea73 Wrappers - Added 'wrappers' and 'step_count' property + monitor support (#288)
* Wrappers - Added 'wrappers' and 'step_count' property + monitor support

* Removed step_count and wrappers from api and monitor

* Removed wrappers and name property
2016-08-13 10:25:19 -07:00
Greg Brockman
e305f95412 Add experimental Wrapper (#276) 2016-08-11 14:45:52 -07:00
Greg Brockman
c4317fc5f9 Handle bad configure calls more nicely 2016-08-05 16:30:24 -07:00
Greg Brockman
996e511562 Get rid of action space validation
This can be implemented by specific environments,
but if it's causing a performance hit in some cases,
it's not worth having in the core
2016-07-11 16:59:24 -07:00
Jonathan Gray
3ae443efb4 fix minor docstring typo in gym/core.py (#225) 2016-06-29 01:47:55 -07:00
John Schulman
d90d701534 get rid of warning for observations out of bounds 2016-06-23 14:58:15 -07:00
Jie Tang
77a437f21b Add an option to env.configure to turn off bounds checking on observation/action spaces 2016-06-22 12:26:43 -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
Greg Brockman
116b03144c Add docstring for monitor property 2016-06-09 11:31:35 -07:00
Greg Brockman
d257dac86e Go back to lazily creating the monitor
The refresh case is complicated enough that special handling is needed anyway
2016-06-09 11:29:34 -07:00
Greg Brockman
e759526268 Handle monitor close better 2016-06-09 11:27:27 -07:00
Greg Brockman
c183708a52 Correct self -> env 2016-06-09 09:45:55 -07:00
Greg Brockman
790f02e471 Create monitor at __new__ time
Only reason we don't already is we didn't have the
__new__ hook when we first wrote this code
2016-06-09 09:26:27 -07:00
Greg Brockman
f6303f6a20 Only warn once about out-of-bound actions and observations (#153) 2016-06-02 10:19:33 -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
8376580c85 Improve closer implementation and docstrings (#126)
* Improve auto close implementation

- Register all envs at initialization time, not just ones created via make
- Simplify names and add more documentation on interface
- Move closer instances into the relevant modules

review-requested: @jietang

* Close environments in the tests

This isn't strictly needed, but means there are fewer Doom
subprocesses hanging around while the tests run.

* Use 4 space indent in comment

* Improve docstrings in core

* Don't pass through args to __new__

The __init__ method gets called once __new__ returns,
so these arguments are either ignored (Python 2) or
result in an error (Python 3). The __init__ method
automatically gets called with the correct arguments.

* Fixup comments
2016-05-27 12:16:35 -07:00
Jie Tang
48c689efea Fix action space warning (fixes #108) 2016-05-23 10:59:42 -07:00
Jie Tang
b92796ae89 Renaming close_registry to closer 2016-05-18 01:27:58 -07:00
Jie Tang
72d29a52f6 Make close() idempotent, add tests, minor fixes 2016-05-16 23:11:50 -07:00
Jie Tang
751dcc15b1 Add close() to Env, add functionality to call close() on exit 2016-05-16 14:58:36 -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
Greg Brockman
656646ab37 Stop warning if observation not in observation space 2016-05-10 21:49:39 -07:00
Dominik
da29f0f2f6 Fix observation_space for BipedalWalker (#84)
* Fix observation_space for Bipedal_walker and add warning if observation doesn't fit observation_space

* Remove observation state check on reset.

Multiple environments call reset before action and observation spaces
are initialized.
2016-05-10 20:36:09 -07:00
Greg Brockman
81a4c3e57c Clarify reward docstring
Closes #70
2016-05-08 13:20:01 -07:00
Jonas Schneider
4519a6ffe3 Warn instead of raising on invalid action 2016-05-03 22:27:26 -04:00
JKCooper2
3c983b9f1d Set restriction on selected actions for MountainCar-v0 (#47)
* Set restriction on selected actions

* Used self.action_space instead of custom set

* Move action validation to core.py
2016-05-03 21:40:24 -04:00
Greg Brockman
99f40a2fc1 Add reward_range parameter to Env
Closes #33
2016-04-30 22:53:13 -04:00
Greg Brockman
317a2be993 Update Env docstrings 2016-04-28 10:33:41 -07:00
Greg Brockman
e8f2980603 Initial release. Hello world :). 2016-04-27 08:00:58 -07:00