Fixed a fatal flaw with CompositionalObservable
This commit is contained in:
parent
8706462358
commit
a41f93beed
@ -342,18 +342,12 @@ class CompositionalObservable(Observable):
|
|||||||
for i, obs in enumerate(self.observables):
|
for i, obs in enumerate(self.observables):
|
||||||
space = obs.get_observation_space()
|
space = obs.get_observation_space()
|
||||||
num += math.prod(space.shape)
|
num += math.prod(space.shape)
|
||||||
try: # TODO: lol
|
if not i:
|
||||||
low = min(low, float(space.low[0].item()))
|
low = space.low.reshape((-1))
|
||||||
high = max(high, float(space.high[0].item()))
|
high = space.high.reshape((-1))
|
||||||
except:
|
else:
|
||||||
pass
|
low = np.hstack((low, space.low.reshape((-1))))
|
||||||
if False:
|
high = np.hstack((high, space.high.reshape((-1))))
|
||||||
if not i:
|
|
||||||
low = space.low
|
|
||||||
high = space.high
|
|
||||||
else:
|
|
||||||
low = np.vstack((low, space.low))
|
|
||||||
high = np.vstack((high, space.high))
|
|
||||||
return spaces.Box(low=low, high=high,
|
return spaces.Box(low=low, high=high,
|
||||||
shape=(num,), dtype=np.float32)
|
shape=(num,), dtype=np.float32)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user