usage of spaces.Box for discrete spaces (opanai gym.Env)

Viewed 20

I'm having trouble understanding the usage of spaces.Box.

I'm trying to set up a solitaire card game. Checked it out for chess, board is as Box(-6,6,(8,8)) defined, which is pretty straight forward (piece types with suits -6,6, 8x8 board). Accordingly, I try to define the card tableau as a box (0,52,(12,8) i.e. 52 cards, 12 rows, 8 columns. Now, the gym check_env complains that state is not defined as a 1D vector. Trying to return it as flatten, it does not match the defined observation space ( Box(..) ).

Can I, and how correctly use spaces.Box for discrete state spaces? (the classic example "cartpole" is continuous).

0 Answers
Related