Open rusu24edward opened 2 years ago
It's not exactly the same between the ravel wrapper and the flatten wrapper because the ravel wrapper has some extra steps to check that the space is discretizable. Also, it's not that big of a deal yet. Maybe when there are more SAR wrappers and it becomes obvious that we would save a lot of code duplication. Marking this as probably not for now, will update later if needed.
SAR Wrapper can modify the (SAR) data, but it does not explicitly require that the spaces be modified too. It leaves that to the derived classes, which have to modify the space in order for the loop to work (because it checks
point in agent.{action,observation}_space
). In #304, the derived SAR Wrappers also modify thenull_{action,observation}
. This can be moved in the SAR Wrapper itself by making ravel, flatten a class function. Call it something likewrap
andwrap_space
. Then the SAR Wrapper can call these, and all the wrappings will happen automatically with the derived classes defining the implementation.