I am trying to develop a custom gym environment for a Reinforcement Learning Use case. In this environment my main aim is to predict the state based on several action that are to be taken in each step i.e. simply my observation_space was dependent on multiple actions in the action_space. I tried providing several actions to the environment within a Tuple of different Box spaces values as shown below:
self.action_space = Tuple([Box(low=np.array([22]),high=np.array([25])),
Box(low=np.array([0]), high=np.array([230])),
Box(low=np.array([0]), high=np.array([33])),
Box(low=np.array([0]), high=np.array([3.5]))])
Multiple Action Spaces:
The environment was built successfully, however, when I tried training the PPO model on the specified environment I am facing the following error:
Error: AssertionError: The algorithm only supports (<class 'gym.spaces.box.Box'>, <class 'gym.spaces.discrete.Discrete'>, <class 'gym.spaces.multi_discrete.MultiDiscrete'>, <class 'gym.spaces.multi_binary.MultiBinary'>) as action spaces but Tuple(Box(22.0, 25.0, (1,), float32), Box(0.0, 230.0, (1,), float32), Box(0.0, 33.0, (1,), float32), Box(0.0, 3.5, (1,), float32)) was provided
Error:
Can anyone suggest how to deal with this issue when working with multiple actions within a single action space and what exactly the error is signifying since what I understood was we needed to pass gym spaces within tuple however I had passed the Box space yet the error is thrown?