nes-py icon indicating copy to clipboard operation
nes-py copied to clipboard

fixed new gym API related to step() and reset()

Open spyroot opened this issue 3 years ago • 1 comments

Description

There are several issues related to changes in API. I re-adjusted all code, so it returned truncated in step and readjusted reset to match what the gym expected. In parallel, fixed Mario env. Note old code won't work with this since GYM now return five elements in a tuple vs. 4. Same for reset. I also re-adjusted all the unit tests and examples, so it matched and passed all tests.

  • Fixes #Incorrect number of arguments from call to env.step(action) #119

Type of change

Please select all relevant options:

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [ x] Unit test
  • [x] run gyp-super Mario ( with readjusted step /reset) and its unit test.

Test Configuration

  • Operating System: 12.5.1 mac os
  • Python version: 3.10
  • C++ compiler version: Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: x86_64-apple-darwin21.6.0 Thread model: posix

Checklist

  • [ x] My code follows the style guidelines of this project
  • [ x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [ x] I have added tests that prove my fix is effective or that my feature works

spyroot avatar Oct 13 '22 09:10 spyroot

Any reason why this shouldn't be merged with the suggested edits?

alrdebugne avatar Jun 01 '23 17:06 alrdebugne