Skip to content

Commit

Permalink
fix naming for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Kautenja committed Jan 16, 2019
1 parent 142da44 commit 710fa1d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ The random stage selection environment randomly selects a stage and allows a
single attempt to clear it. Upon a death and subsequent call to `reset`, the
environment randomly selects a new stage. This is only available for the
standard Super Mario Bros. game, _not_ Lost Levels (at the moment). To use
these environments, append `RandomLevels` to the `SuperMarioBros` id. For
these environments, append `RandomStages` to the `SuperMarioBros` id. For
example, to use the standard ROM with random stage selection use
`SuperMarioBrosRandomLevels-v0`. To seed the random stage selection use the
`SuperMarioBrosRandomStages-v0`. To seed the random stage selection use the
`seed` method of the env, i.e., `env.seed(1)`, before any calls to `reset`.

## Step
Expand Down
4 changes: 2 additions & 2 deletions gym_super_mario_bros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Registration code of Gym environments in this package."""
from .smb_env import SuperMarioBrosEnv
from .smb_random_levels_env import SuperMarioBrosRandomLevelsEnv
from .smb_random_stages_env import SuperMarioBrosRandomStagesEnv
from ._registration import make


# define the outward facing API of this package
__all__ = [
make.__name__,
SuperMarioBrosEnv.__name__,
SuperMarioBrosRandomLevelsEnv.__name__,
SuperMarioBrosRandomStagesEnv.__name__,
]
10 changes: 5 additions & 5 deletions gym_super_mario_bros/_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _register_mario_env(id, is_random=False, **kwargs):
# if the is random flag is set
if is_random:
# set the entry point to the random level environment
entry_point = 'gym_super_mario_bros:SuperMarioBrosRandomLevelsEnv'
entry_point = 'gym_super_mario_bros:SuperMarioBrosRandomStagesEnv'
else:
# set the entry point to the standard Super Mario Bros. environment
entry_point = 'gym_super_mario_bros:SuperMarioBrosEnv'
Expand All @@ -41,10 +41,10 @@ def _register_mario_env(id, is_random=False, **kwargs):


# Super Mario Bros. Random Levels
_register_mario_env('SuperMarioBrosRandomLevels-v0', is_random=True, rom_mode='vanilla')
_register_mario_env('SuperMarioBrosRandomLevels-v1', is_random=True, rom_mode='downsample')
_register_mario_env('SuperMarioBrosRandomLevels-v2', is_random=True, rom_mode='pixel')
_register_mario_env('SuperMarioBrosRandomLevels-v3', is_random=True, rom_mode='rectangle')
_register_mario_env('SuperMarioBrosRandomStages-v0', is_random=True, rom_mode='vanilla')
_register_mario_env('SuperMarioBrosRandomStages-v1', is_random=True, rom_mode='downsample')
_register_mario_env('SuperMarioBrosRandomStages-v2', is_random=True, rom_mode='pixel')
_register_mario_env('SuperMarioBrosRandomStages-v3', is_random=True, rom_mode='rectangle')


# Super Mario Bros. 2 (Lost Levels)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .smb_env import SuperMarioBrosEnv


class SuperMarioBrosRandomLevelsEnv(gym.Env):
class SuperMarioBrosRandomStagesEnv(gym.Env):
"""A Super Mario Bros. environment that randomly selects levels."""

# relevant meta-data about the environment
Expand Down Expand Up @@ -162,4 +162,4 @@ def get_keys_to_action(self):


# explicitly define the outward facing API of this module
__all__ = [SuperMarioBrosRandomLevelsEnv.__name__]
__all__ = [SuperMarioBrosRandomStagesEnv.__name__]
4 changes: 2 additions & 2 deletions gym_super_mario_bros/tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ShouldMakeSuperMarioBros(ShouldMakeEnv, TestCase):
env_id = ['SuperMarioBros-v{}'.format(v) for v in range(4)]


class ShouldMakeSuperMarioBrosRandomLevels(ShouldMakeEnv, TestCase):
class ShouldMakeSuperMarioBrosRandomStages(ShouldMakeEnv, TestCase):
# the random number seed for this environment
seed = 1
# the amount of time left
Expand All @@ -65,7 +65,7 @@ class ShouldMakeSuperMarioBrosRandomLevels(ShouldMakeEnv, TestCase):
# the current stage
stage = 4
# the environments ID for all versions of Super Mario Bros
env_id = ['SuperMarioBrosRandomLevels-v{}'.format(v) for v in range(4)]
env_id = ['SuperMarioBrosRandomStages-v{}'.format(v) for v in range(4)]


class ShouldMakeSuperMarioBrosLostLevels(ShouldMakeEnv, TestCase):
Expand Down

0 comments on commit 710fa1d

Please sign in to comment.