Skip to content

Commit

Permalink
Add a check to ensure that 3-dimensional actions are being passed in.
Browse files Browse the repository at this point in the history
  • Loading branch information
psc-g committed Jul 5, 2024
1 parent bf6610d commit 0eaf8db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/python/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ def step( # pyright: ignore[reportIncompatibleMethodOverride]
reward = 0.0
for _ in range(frameskip):
if self.continuous:
r, theta, fire = tuple(action)
action = tuple(action)
if len(action) != 3:
raise ValueError('Actions must have 3-dimensions.')

r, theta, fire = action
reward += self.ale.actContinuous(r, theta, fire)
else:
reward += self.ale.act(self._action_set[action])
Expand Down

0 comments on commit 0eaf8db

Please sign in to comment.