Skip to content

Commit 0c5c47a

Browse files
committed
Fixed one bug for MultiDiscrete observation space.
1 parent 6de6e0e commit 0c5c47a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

slm_lab/env/base.py

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def _get_spaces(self, u_env):
142142
def _get_observable_dim(self, observation_space):
143143
'''Get the observable dim for an agent in env'''
144144
state_dim = observation_space.shape
145+
if isinstance(observation_space, spaces.MultiDiscrete):
146+
state_dim = observation_space.nvec.tolist()
145147
if len(state_dim) == 1:
146148
state_dim = state_dim[0]
147149
return {'state': state_dim}

0 commit comments

Comments
 (0)