You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Grid2Op most classes, including Actions, Environments, Observations and Spaces, inherit from the grid2op.Space.GridObject.GridObjects class. The GridObjects class has a number of class attributes, which are then shared among any instantiations of the GridObjects class (e.g. a specific observation). As a result, if you modify the attribute on one instance of that class (i.e. overriding it) this does NOT permeate to all other objects (e.g. the Environment will still have the original attribute value).
Changing attributes on specific objects is therefore not recommended. However, in order to implement a per-episode variation in which loads are flexible (for demand response) it was necessary to do this. If you are careful about which attributes you change and when, this does work, even though it is not ideal. Let us assume that this is the only way to do it.
My problem is this: If you try and save an observation to disk via .to_vect() and then load it with an observation space, the object will be loaded without the change in attribute. So even though my setup works with load masking, I cannot replay / store the results correctly for later visualization. Does anyone have a creative idea how to get around this to get the observation space to correctly reload the modified observation:
My current workaround is to separately save this load_flexible mask to file using np.save(...), but this requires effectively duplicating CompactEpisodeData.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In Grid2Op most classes, including Actions, Environments, Observations and Spaces, inherit from the grid2op.Space.GridObject.GridObjects class. The GridObjects class has a number of class attributes, which are then shared among any instantiations of the GridObjects class (e.g. a specific observation). As a result, if you modify the attribute on one instance of that class (i.e. overriding it) this does NOT permeate to all other objects (e.g. the Environment will still have the original attribute value).
Changing attributes on specific objects is therefore not recommended. However, in order to implement a per-episode variation in which loads are flexible (for demand response) it was necessary to do this. If you are careful about which attributes you change and when, this does work, even though it is not ideal. Let us assume that this is the only way to do it.
My problem is this: If you try and save an observation to disk via .to_vect() and then load it with an observation space, the object will be loaded without the change in attribute. So even though my setup works with load masking, I cannot replay / store the results correctly for later visualization. Does anyone have a creative idea how to get around this to get the observation space to correctly reload the modified observation:
My current workaround is to separately save this load_flexible mask to file using np.save(...), but this requires effectively duplicating CompactEpisodeData.
Beta Was this translation helpful? Give feedback.
All reactions