Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow discrete space to be iterable #1021

Closed
wants to merge 1 commit into from
Closed

Allow discrete space to be iterable #1021

wants to merge 1 commit into from

Conversation

EugenHotaj
Copy link

It seems intuitive that spaces should be iterable (particularly discrete spaces). For example, if this represents an action space one could iterate as follows:

for action in actions:
...

instead of:

for action in range(actions.n):

It seems intuitive that spaces should be iterable (particularly discrete spaces). For example, if this represents an action space one could iterate as follows:

for action in actions:
  ...

instead of:

for action in range(actions.n):
@EugenHotaj EugenHotaj changed the title Allow discrete state space to be iterable Allow discrete space to be iterable Apr 26, 2018
@geyang
Copy link
Contributor

geyang commented Jul 5, 2018

Good idea, non-ideal stateful implementation.

@pzhokhov
Copy link
Collaborator

this feels vaguely unnecessary... I am not sure statement for action in action_space: is more lucid than for action in range(action_space.n). In order for this to make sense, I'd like two things:

  1. examples of use cases for box (the iterator can return a random walk)
  2. as @episodeyang pointed out, stateless implementation (for instance iterable pattern instead of an iterator, i.e. an iter() method that returns a stateful iterator). Closing this, feel free to reopen with respective changes.

@pzhokhov pzhokhov closed this Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants