Skip to content

Commit

Permalink
Update discrete_act.py (#29)
Browse files Browse the repository at this point in the history
* Update discrete_act.py

Use list operators
Fix docstring
  • Loading branch information
Rolv-Arild committed Oct 24, 2021
1 parent 30c2707 commit f42f8d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rlgym/utils/action_parsers/discrete_act.py
Expand Up @@ -6,7 +6,7 @@

class DiscreteAction(ActionParser):
"""
Simple discrete action space. All the analog actions have 3 bins: -1, 0 and 1.
Simple discrete action space. All the analog actions have 3 bins by default: -1, 0 and 1.
"""

def __init__(self, n_bins=3):
Expand All @@ -15,7 +15,7 @@ def __init__(self, n_bins=3):
self._n_bins = n_bins

def get_action_space(self) -> gym.spaces.Space:
return gym.spaces.MultiDiscrete([self._n_bins, self._n_bins, self._n_bins, self._n_bins, self._n_bins, 2, 2, 2])
return gym.spaces.MultiDiscrete([self._n_bins] * 5 + [2] * 3)

def parse_actions(self, actions: np.ndarray, state: GameState) -> np.ndarray:
actions = actions.reshape((-1, 8))
Expand Down

0 comments on commit f42f8d9

Please sign in to comment.