first step towards simple make interface

This commit is contained in:
romue
2021-11-11 11:56:32 +01:00
parent ea4582a59e
commit f9c05dc3bf
3 changed files with 37 additions and 24 deletions

View File

@ -1,11 +1,12 @@
from environments.factory import rooms
from environments.factory import make
import random
from gym.wrappers import FrameStack
env = rooms(n_agents=2)
n_agents = 4
env = make('DirtyFactory-v0', n_agents=n_agents)
env = FrameStack(env, num_stack=3)
state, *_ = env.reset()
for i in range(1000):
state, *_ = env.step([random.randint(0, 9), random.randint(0, 9)])
state, *_ = env.step([env.unwrapped.action_space.sample() for _ in range(n_agents)])
env.render()