Skip to content

Commit

Permalink
Merge pull request #217 from Farama-Foundation/maze_v5
Browse files Browse the repository at this point in the history
Add `AntMaze_*-v5` environments, featuring support for loading Third party robot models to Maze
  • Loading branch information
Kallinteris-Andreas authored Oct 1, 2024
2 parents b1acee9 + d28a719 commit b9ece07
Show file tree
Hide file tree
Showing 6 changed files with 463 additions and 427 deletions.
359 changes: 120 additions & 239 deletions gymnasium_robotics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,245 +835,126 @@ def _merge(a, b):

# ----- AntMaze -----

register(
id=f"AntMaze_UMaze{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.U_MAZE,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_UMaze{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.U_MAZE,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_G{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_G,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_G{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_G,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_GR{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_GR{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Medium{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_G{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_G{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_GR{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_GR{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_G{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_G{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_GR{suffix}-v3",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_GR{suffix}-v4",
entry_point="gymnasium_robotics.envs.maze.ant_maze_v4:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)
for version in ["v3", "v4", "v5"]:
register(
id=f"AntMaze_UMaze{suffix}-{version}",
entry_point=f"gymnasium_robotics.envs.maze.ant_maze_{version}:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.U_MAZE,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_G{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_G,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Open_Diverse_GR{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.OPEN_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=700,
)

register(
id=f"AntMaze_Medium{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_G{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Medium_Diverse_GR{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.MEDIUM_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_G{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_G,
},
kwargs,
),
max_episode_steps=1000,
)

register(
id=f"AntMaze_Large_Diverse_GR{suffix}-{version}",
entry_point="gymnasium_robotics.envs.maze.ant_maze:AntMazeEnv",
kwargs=_merge(
{
"maze_map": maps.LARGE_MAZE_DIVERSE_GR,
},
kwargs,
),
max_episode_steps=1000,
)

# ----- PointMaze -----

Expand Down
2 changes: 1 addition & 1 deletion gymnasium_robotics/envs/maze/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from gymnasium_robotics.envs.maze.ant_maze import AntMazeEnv
from gymnasium_robotics.envs.maze.ant_maze_v3 import AntMazeEnv
from gymnasium_robotics.envs.maze.point_maze import PointMazeEnv
File renamed without changes.
Loading

0 comments on commit b9ece07

Please sign in to comment.