Commit Graph

13 Commits

Author SHA1 Message Date
Tristan Deleu
58401db97e Allow custom spaces in VectorEnv (#2038)
* Allow custom observation spaces in VectorEnv

* Replace np.copy by deepcopy in reset of SyncVectorEnv

* Add tests for VectorEnv with custom spaces

* Add tests for shared memory and batches of custom spaces

* Remove unused import in VectorEnv test

* Add warning note in the Space class for custom spaces
2020-09-21 13:38:51 -07:00
Tristan Deleu
1a92bc6c83 Remove Python 2 compatibility in VectorEnv (#2034) 2020-09-11 15:07:27 -07: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
Xingdong Zuo
fe244fadf6 [gym.vector]: a genericclose with user-defined close_extras (#1631)
* Update vector_env.py

* Update sync_vector_env.py

* Update async_vector_env.py

* Update vector_env.py

* Update async_vector_env.py
2019-10-25 15:18:54 -07:00
pzhokhov
51136b1290 vector env updates (#1706)
* make daemon=True an option of async_vector_env

* custom worker in async_vector_env

* add compatibility methods to SyncVectorEnv

* fix name in sync_vector_env

* vectorenv api cleanup

* add docstrings for daemon and worker options in AsyncVectorEnv
2019-10-09 15:08:10 -07:00
Tristan Deleu
50ef7bf199 Fix AsyncVectorEnv with spawn context and shared memory (Fixes #1542) 2019-07-12 14:44:25 -07:00
Tristan Deleu
6ffcd212df Check for closed pipes in close for AsyncVectorEnv 2019-06-28 16:30:53 -07:00
Tristan Deleu
316156903d Check if the pipe is not None is _poll (Fixes #1542) 2019-06-28 16:30:53 -07:00
Tristan Deleu
cab1d0ec38 Add success flag in results from workers in AsyncVectorEnv 2019-06-28 16:30:53 -07:00
Tristan Deleu
ad8b3b20e6 Move _raise_if_errors after recv in AsyncVectorEnv (Fixes #1546) 2019-06-28 16:30:53 -07:00
Tristan Deleu
2e56028e9a Handle KeyboardInterrupt exception in AsyncVectorEnv (Fixes #1543) 2019-06-28 15:00:49 -07:00
Tristan Deleu
02cff040ee Fix typo in AsyncVectorEnv (Fixes #1544) 2019-06-28 14:42:11 -07:00
Tristan Deleu
c6a97e17ee Vectorized environments (#1513)
* Initial version of vectorized environments

* Raise an exception in the main process if child process raises an exception

* Add list of exposed functions in vector module

* Use deepcopy instead of np.copy

* Add documentation for vector utils

* Add tests for copy in AsyncVectorEnv

* Add example in documentation for batch_space

* Add cloudpickle dependency in setup.py

* Fix __del__ in VectorEnv

* Check if all observation spaces are equal in AsyncVectorEnv

* Check if all observation spaces are equal in SyncVectorEnv

* Fix spaces non equality in SyncVectorEnv for Python 2

* Handle None parameter in create_empty_array

* Fix check_observation_space with spaces equality

* Raise an exception when operations are out of order in AsyncVectorEnv

* Add version requirement for cloudpickle

* Use a state instead of binary flags in AsyncVectorEnv

* Use numpy.zeros when initializing observations in vectorized environments

* Remove poll from public API in AsyncVectorEnv

* Remove close_extras from VectorEnv

* Add test between AsyncVectorEnv and SyncVectorEnv

* Remove close in check_observation_space

* Add documentation for seed and close

* Refactor exceptions for AsyncVectorEnv

* Close pipes if the environment raises an error

* Add tests for out of order operations

* Change default argument in create_empty_array to np.zeros

* Add get_attr and set_attr methods to VectorEnv

* Improve consistency in SyncVectorEnv
2019-06-21 14:29:44 -07:00