Skip to content

Commit

Permalink
Merge pull request #4 from SarvagyaVaish/main
Browse files Browse the repository at this point in the history
Fix _action_to_direction usage
  • Loading branch information
pseudo-rnd-thoughts authored Jan 3, 2024
2 parents 59d5aed + b5be153 commit 92c7847
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions template/{{environment_name}}/envs/grid_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def __init__(self, render_mode=None, size=5):
i.e. 0 corresponds to "right", 1 to "up" etc.
"""
self._action_to_direction = {
Actions.right: np.array([1, 0]),
Actions.up: np.array([0, 1]),
Actions.left: np.array([-1, 0]),
Actions.down: np.array([0, -1]),
Actions.right.value: np.array([1, 0]),
Actions.up.value: np.array([0, 1]),
Actions.left.value: np.array([-1, 0]),
Actions.down.value: np.array([0, -1]),
}

assert render_mode is None or render_mode in self.metadata["render_modes"]
Expand Down

0 comments on commit 92c7847

Please sign in to comment.