Skip to content

Commit

Permalink
[Update vector_env.py]: add some documentations (openai#1629)
Browse files Browse the repository at this point in the history
* Update vector_env.py

* Update vector_env.py
  • Loading branch information
zuoxingdong authored and pzhokhov committed Oct 25, 2019
1 parent 19cb6bd commit b6b0600
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions gym/vector/vector_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@


class VectorEnv(gym.Env):
"""Base class for vectorized environments.
r"""Base class for vectorized environments.
Each observation returned from vectorized environment is a batch of observations
for each sub-environment. And :meth:`step` is also expected to receive a batch of
actions for each sub-environment.
.. note::
All sub-environments should share the identical observation and action spaces.
In other words, a vector of multiple different environments is not supported.
Parameters
----------
Expand Down Expand Up @@ -40,7 +49,8 @@ def reset_wait(self, **kwargs):
raise NotImplementedError()

def reset(self):
"""
r"""Reset all sub-environments and return a batch of initial observations.
Returns
-------
observations : sample from `observation_space`
Expand All @@ -56,7 +66,8 @@ def step_wait(self, **kwargs):
raise NotImplementedError()

def step(self, actions):
"""
r"""Take an action for each sub-environments.
Parameters
----------
actions : iterable of samples from `action_space`
Expand All @@ -74,8 +85,9 @@ def step(self, actions):
A vector whose entries indicate whether the episode has ended.
infos : list of dict
A list of auxiliary diagnostic informations.
A list of auxiliary diagnostic information dicts from sub-environments.
"""

self.step_async(actions)
return self.step_wait()

Expand Down

0 comments on commit b6b0600

Please sign in to comment.