|
@@ -98,7 +98,7 @@ class StateBonus(gym.Wrapper):
|
|
|
return self.env.reset(**kwargs)
|
|
|
|
|
|
|
|
|
-class ImgObsWrapper(gym.ObservationWrapper):
|
|
|
+class ImgObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Use the image as the only observation output, no language/mission.
|
|
|
"""
|
|
@@ -111,7 +111,7 @@ class ImgObsWrapper(gym.ObservationWrapper):
|
|
|
return obs["image"]
|
|
|
|
|
|
|
|
|
-class OneHotPartialObsWrapper(gym.ObservationWrapper):
|
|
|
+class OneHotPartialObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Wrapper to get a one-hot encoding of a partially observable
|
|
|
agent view as observation.
|
|
@@ -151,7 +151,7 @@ class OneHotPartialObsWrapper(gym.ObservationWrapper):
|
|
|
return {**obs, "image": out}
|
|
|
|
|
|
|
|
|
-class RGBImgObsWrapper(gym.ObservationWrapper):
|
|
|
+class RGBImgObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Wrapper to use fully observable RGB image as observation,
|
|
|
This can be used to have the agent to solve the gridworld in pixel space.
|
|
@@ -183,7 +183,7 @@ class RGBImgObsWrapper(gym.ObservationWrapper):
|
|
|
return {**obs, "image": rgb_img}
|
|
|
|
|
|
|
|
|
-class RGBImgPartialObsWrapper(gym.ObservationWrapper):
|
|
|
+class RGBImgPartialObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Wrapper to use partially observable RGB image as observation.
|
|
|
This can be used to have the agent to solve the gridworld in pixel space.
|
|
@@ -214,7 +214,7 @@ class RGBImgPartialObsWrapper(gym.ObservationWrapper):
|
|
|
return {**obs, "image": rgb_img_partial}
|
|
|
|
|
|
|
|
|
-class FullyObsWrapper(gym.ObservationWrapper):
|
|
|
+class FullyObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Fully observable gridworld using a compact grid encoding
|
|
|
"""
|
|
@@ -243,7 +243,7 @@ class FullyObsWrapper(gym.ObservationWrapper):
|
|
|
return {**obs, "image": full_grid}
|
|
|
|
|
|
|
|
|
-class DictObservationSpaceWrapper(gym.ObservationWrapper):
|
|
|
+class DictObservationSpaceWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Transforms the observation space (that has a textual component) to a fully numerical observation space,
|
|
|
where the textual instructions are replaced by arrays representing the indices of each word in a fixed vocabulary.
|
|
@@ -361,7 +361,7 @@ class DictObservationSpaceWrapper(gym.ObservationWrapper):
|
|
|
return obs
|
|
|
|
|
|
|
|
|
-class FlatObsWrapper(gym.ObservationWrapper):
|
|
|
+class FlatObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Encode mission strings using a one-hot scheme,
|
|
|
and combine these with observed images into one flat array
|
|
@@ -455,7 +455,7 @@ class ViewSizeWrapper(gym.Wrapper):
|
|
|
return {**obs, "image": image}
|
|
|
|
|
|
|
|
|
-class DirectionObsWrapper(gym.ObservationWrapper):
|
|
|
+class DirectionObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Provides the slope/angular direction to the goal with the observations as modeled by (y2 - y2 )/( x2 - x1)
|
|
|
type = {slope , angle}
|
|
@@ -489,7 +489,7 @@ class DirectionObsWrapper(gym.ObservationWrapper):
|
|
|
return obs
|
|
|
|
|
|
|
|
|
-class SymbolicObsWrapper(gym.ObservationWrapper):
|
|
|
+class SymbolicObsWrapper(gym.Wrapper):
|
|
|
"""
|
|
|
Fully observable grid with a symbolic state representation.
|
|
|
The symbol is a triple of (X, Y, IDX), where X and Y are
|