-
-
Notifications
You must be signed in to change notification settings - Fork 903
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
[Question] Possible ways to implement "exclusive dictionary" action spaces #594
Comments
This is an interesting idea, we considered adding this more for PettingZoo where you could have a variable number of agents acting in a timestep. |
I think it might be easy to have this space, but how to make an appropriate flatten version of that would be something to think about. |
I'm cautiously positive about this, and I feel like this might have a solid mathematical foundation somewhere behind it, much like algebraic data types. We already have product types (tuples and dicts), this would be a sum type. A practical-ish example of a sum space would be something like: Union(
Discrete(num_keys),
Box(..., size=(2,))
) which roughly represents what you can do with a keyboard and mouse - press a button or move the mouse (ignoring some domain-specific nuances like the ability to press multiple buttons at once) To have it a bit more grounded, could you share your specific application? Like where would this actually be useful? Flattening probably would be fine the same way as for Tuple spaces, it can't be bijective anyways |
I think the keyboard & mouse example is a good example, especially for different structures of exclusive actions. |
My only issue is the name, @SiyuanQi Would you be interested making a PR for this? |
Wait isn't that exactly the opposite of what |
That is a good point, ignore tired mark |
I am interested in making a PR for this, but I still feel the flattening is worth more discussion. Some questions that I don't have a clear idea now: how do we distinguish it from ordinary dictionaries in the flattened version? How do we know if an action is chosen or not from the flattened vector? Maybe we can simply add a |
I think for |
|
Question
In Gymnasium we can define an action space with two possible actions like below:
where both action
a
andb
would be executed.I wonder if there's a way in Gymnasium to implement an "exclusive dictionary" or "discrete dictionary", so that the agent can only choose from either
a
orb
to perform?In a more general case,
a
andb
can be different composite spaces (and possibly "exclusive dictionaries"), which makes the space hierarchical.The text was updated successfully, but these errors were encountered: