Skip to content
Snippets Groups Projects
Commit 7a28373a authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

.

parent 57fd865a
No related branches found
No related tags found
No related merge requests found
......@@ -101,11 +101,12 @@ class Demo:
# update the actions
action_dict.update({iAgent: action})
# render
self.renderer.renderEnv(show=True, show_observations=False)
# environment step (apply the actions to all agents)
next_obs, all_rewards, done, _ = self.env.step(action_dict)
# render
self.renderer.renderEnv(show=True, show_observations=False)
if done['__all__']:
break
......
......@@ -673,15 +673,9 @@ class RenderTool(object):
direction = agent.direction
old_direction = agent.direction
if agent.position[0] == agent.target[0] and agent.position[1] == agent.target[1]:
# setAgentAt uses the agent index for the color
self.gl.setCellOccupied(iAgent, *(agent.position))
self.gl.setCellOccupied(iAgent, *(agent.old_position))
else:
# setAgentAt uses the agent index for the color
self.gl.setCellOccupied(iAgent, *(agent.position))
position = agent.position
self.gl.setAgentAt(iAgent, *position, old_direction, direction, iSelectedAgent == iAgent)
# setAgentAt uses the agent index for the color
self.gl.setCellOccupied(iAgent, *(agent.position))
self.gl.setAgentAt(iAgent, *position, old_direction, direction, iSelectedAgent == iAgent)
if show_observations:
self.renderObs(range(env.get_num_agents()), env.dev_obs_dict)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment