Skip to content

Commit

Permalink
commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
mishmish66 committed Jan 17, 2024
1 parent da9867b commit 2ec7bac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gymnasium_robotics/envs/maze/maze_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,19 @@ def make_maze(
maze._unique_reset_locations += maze._combined_locations

# Save new xml with maze to a temporary file
# Make temporary file object and make the string path to our new file
tmp_dir = tempfile.TemporaryDirectory()
temp_xml_path = path.join(tmp_dir.name, "ant_maze.xml")

# Write the new xml to the temporary file
with open(temp_xml_path, "wb") as xml_file:
tree.write(xml_file)

return maze, temp_xml_path, tmp_dir
return (
maze,
temp_xml_path,
tmp_dir, # The tmp_dir object is returned to keep it alive
)


class MazeEnv(GoalEnv):
Expand Down

0 comments on commit 2ec7bac

Please sign in to comment.