thomashirtz / gym-hybrid

Collection of OpenAI parametrized action-space environments.
55 stars 9 forks source link

Shape of action space #10

Closed ddharshan closed 1 year ago

ddharshan commented 1 year ago

Hi, I am trying to define interval in between continuous action space as self.action_space = Tuple((Discrete(2), Box(-10, 10, (2,)))), in this parameterized action space. could u please tell me how to define in your gym- environment?

parameters_min = np.array([0, -1]) parameters_max = np.array([1, +1])

    self.action_space = spaces.Tuple((spaces.Discrete(3),
                                      spaces.Box(parameters_min, parameters_max))) 

I defined as

self.action_space = spaces.Tuple((spaces.Discrete(3),spaces.Box(parameters_min, parameters_max, shape=(0.1, 0.1))))

but got the error as low shape doesn’t match provided shape

thomashirtz commented 1 year ago

Duplicate from https://github.com/openai/gym/issues/3135 Solution in the thread