Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pettingzoo wrapper changed to gymnasium interface#6211

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexander-zap wants to merge11 commits intoUnity-Technologies:develop
base:develop
Choose a base branch
Loading
fromalexander-zap:pettingzoo_gymnasium_support

Conversation

@alexander-zap
Copy link

@alexander-zapalexander-zap commentedJun 13, 2025
edited
Loading

Proposed change(s)

I adjusted the Unity Pettingzoo Wrapper to support the gymnasium interface (gymnasium>=0.25).

This includes:

  • returningterminated, truncated on step
  • returninginfo on reset
  • acceptseed andoptions on reset
  • not acceptmode on render

Additionall, I fixed interface problems with pettingzoo implementation:

  • all agents return an observations synchronously (instead of having steps where only one agent returns an observation)
  • in case the agent sends a TerminationStepand a DecisionStep after, the reward from the termination step should be taken (but for observations it's the other way around because of SB3 convention)
  • agents attribute should store agents even if they havejust finished (they should be removed the step after)
  • fixed a bug where a continuous action vector was assigned len(action) * action[0]
  • fixed double removal of an agent from _live_agents for ParallelEnv

Also I bumped the dependencies for pettingzoo to 1.22.0 (because this is there Gymnasium support started on their side).

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

This also could be helpful for:#5890

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

a_zapand others added8 commitsMay 28, 2025 17:29
- added dependency to gymnasium instead of gym- adjusted Unity gym interface to return `truncated` on step- adjusted Unity gym interface to accept `seed` and `options` on reset (not used)- adjusted Unity gym interface to not accept `mode` on reset (not used anyway)- relaxed dependencies to numpy, pettingzoo and Python version
…t returning obs and info; step returning terminated and truncated instead of done)
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign ourContributor License Agreement before we can accept your contribution.
1 out of2 committers have signed the CLA.

✅ alexander-zap
❌ a_zap


a_zap seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, pleaseadd the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let usrecheck it.

@alexander-zapalexander-zap changed the titlePettingzoo gymnasium supportPettingzoo wrapper changed to gymnasium interfaceJun 13, 2025
alexander-zap added3 commitsJune 13, 2025 21:20
…t returning obs and info; step returning terminated and truncated instead of done)
- all agents return an observations synchronously (instead of having steps where only one agent returns an observation)- in case the agent sends a TerminationStep *and* a DecisionStep after, the reward from the termination step should be taken (but for observations it's the other way around because of SB3 convention)- `agents` attribute should store agents even if they have *just* finished (they should be removed the step after)- fixed a bug where a continuous action vector was assigned len(action) * action[0]- fixed double removal of an agent from _live_agents for ParallelEnv
@alexander-zap
Copy link
Author

Should also solve#6214

@maryamziaamaryamziaa self-requested a reviewSeptember 2, 2025 21:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@maryamziaamaryamziaaAwaiting requested review from maryamziaa

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@alexander-zap@CLAassistant

[8]ページ先頭

©2009-2025 Movatter.jp