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

fix the rendering bug of MPE environment #1130

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

xixinzhang
Copy link
Contributor

Description

  • Bug Description: When using the following example code of environment simple_adversary_v3 as provided in the PettingZoo Doc, the rendering window disappears in a flash.
    from pettingzoo.mpe import simple_adversary_v3
    
    env = simple_adversary_v3.parallel_env(render_mode="human")
    observations, infos = env.reset()
    
    while env.agents:
        # this is where you would insert your policy
        actions = {agent: env.action_space(agent).sample() for agent in env.agents}
    
        observations, rewards, terminations, truncations, infos = env.step(actions)
    env.close()
  • Bug location: In file pettingzoo/mpe/_mpe_utils/simple_env.py
    The variable "render_fps": 10 in line 34 is not used to control the rendering speed.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Please attach before and after screenshots of the change if applicable.
To upload images to a PR -- simply drag and drop or copy paste.

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have run pytest -v and no errors are present.
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I solved any possible warnings that pytest -v has generated that are related to my code to the best of my knowledge.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@elliottower
Copy link
Member

Thanks for catching this, going to check the other MPE environments right now to make sure there's nothing else that has this issue. I went through the other non-MPE environments a little while back to fix this but I wasn't familiar with MPE (and it is being moved to a separate repo, MPE2 in the future)

@elliottower
Copy link
Member

Okay yeah this looks good, I see it's a helper util for all the MPE envs.

@elliottower elliottower merged commit e9b4001 into Farama-Foundation:master Nov 9, 2023
43 checks passed
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.

2 participants