applied formatter

This commit is contained in:
NM512
2023-07-23 22:02:06 +09:00
parent afa5ab988d
commit 12ed21e06d
10 changed files with 506 additions and 440 deletions

View File

@@ -52,7 +52,6 @@ class OneHotAction(gym.Wrapper):
super().__init__(env)
self._random = np.random.RandomState()
def action_space(self):
shape = (self.env.action_space.n,)
space = gym.spaces.Box(low=0, high=1, shape=shape, dtype=np.float32)
@@ -83,7 +82,6 @@ class RewardObs(gym.Wrapper):
def __init__(self, env):
super().__init__(env)
def observation_space(self):
spaces = self.env.observation_space.spaces
if "reward" not in spaces:
@@ -110,17 +108,16 @@ class SelectAction(gym.Wrapper):
super().__init__(env)
self._key = key
def step(self, action):
return self.env.step(action[self._key])
class UUID(gym.Wrapper):
def __init__(self, env):
super().__init__(env)
timestamp = datetime.datetime.now().strftime("%Y%m%dT%H%M%S")
self.id = f"{timestamp}-{str(uuid.uuid4().hex)}"
def reset(self):
timestamp = datetime.datetime.now().strftime("%Y%m%dT%H%M%S")
self.id = f"{timestamp}-{str(uuid.uuid4().hex)}"