mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-12-14 03:00:37 +01:00
Equalize rendering for TSP and RL agents
This commit is contained in:
@@ -80,11 +80,14 @@ def run_tsp_setting(config_name, emergent_phenomenon):
|
||||
break
|
||||
while not done:
|
||||
a = [x.predict() for x in agents]
|
||||
# Have this condition, to terminate as soon as all dirt piles are collected. This ensures that the implementation
|
||||
# of the TSP agent is equivalent to that of the RL agent
|
||||
if 'DirtPiles' in list(factory.state.entities.keys()) and factory.state.entities['DirtPiles'].global_amount == 0.0:
|
||||
break
|
||||
obs_type, _, _, done, info = factory.step(a)
|
||||
if render:
|
||||
factory.render()
|
||||
if done:
|
||||
print(f'Episode {episode} done...')
|
||||
break
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user