mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-05-23 15:26:43 +02:00
Restructuring
This commit is contained in:
parent
7b4060a042
commit
7893e1131e
@ -209,7 +209,7 @@ if __name__ == '__main__':
|
|||||||
allow_square_movement=True,
|
allow_square_movement=True,
|
||||||
allow_no_op=False)
|
allow_no_op=False)
|
||||||
env = SimpleFactory(dirt_properties=dirt_props, movement_properties=move_props, n_agents=N_AGENTS, pomdp_radius=2, max_steps=400, omit_agent_slice_in_obs=False)
|
env = SimpleFactory(dirt_properties=dirt_props, movement_properties=move_props, n_agents=N_AGENTS, pomdp_radius=2, max_steps=400, omit_agent_slice_in_obs=False)
|
||||||
env = DummyVecEnv([lambda: env])
|
# env = DummyVecEnv([lambda: env])
|
||||||
print(env)
|
print(env)
|
||||||
from stable_baselines3.dqn import DQN
|
from stable_baselines3.dqn import DQN
|
||||||
|
|
||||||
|
@ -210,6 +210,7 @@ class BaseFactory(gym.Env):
|
|||||||
|
|
||||||
# Step the door close intervall
|
# Step the door close intervall
|
||||||
agents_pos = [agent.pos for agent in self._agent_states]
|
agents_pos = [agent.pos for agent in self._agent_states]
|
||||||
|
if self.has_doors:
|
||||||
for door_i, door in enumerate(self._door_states):
|
for door_i, door in enumerate(self._door_states):
|
||||||
if door.is_open and door.time_to_close and door.pos not in agents_pos:
|
if door.is_open and door.time_to_close and door.pos not in agents_pos:
|
||||||
door.time_to_close -= 1
|
door.time_to_close -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user