mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-05-23 07:16:44 +02:00
13 lines
368 B
Python
13 lines
368 B
Python
import gymnasium as gym
|
|
|
|
|
|
class MarlFrameStack(gym.ObservationWrapper):
|
|
"""todo @romue404"""
|
|
def __init__(self, env):
|
|
super().__init__(env)
|
|
|
|
def observation(self, observation):
|
|
if isinstance(self.env, gym.wrappers.FrameStack) and self.env.unwrapped.n_agents > 1:
|
|
return observation[0:].swapaxes(0, 1)
|
|
return observation
|