Skip to content
Snippets Groups Projects
Commit 15a63e88 authored by Erik Nygren's avatar Erik Nygren :bullettrain_front:
Browse files

introduced depot for moving agents after they finished

parent dc78ca6e
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ from flatland.envs.schedule_generators import random_schedule_generator, Schedul ...@@ -24,6 +24,7 @@ from flatland.envs.schedule_generators import random_schedule_generator, Schedul
m.patch() m.patch()
DEPOT_POSITION = (-10, -10)
class RailEnvActions(IntEnum): class RailEnvActions(IntEnum):
DO_NOTHING = 0 # implies change of direction in a dead-end! DO_NOTHING = 0 # implies change of direction in a dead-end!
...@@ -503,8 +504,8 @@ class RailEnv(Environment): ...@@ -503,8 +504,8 @@ class RailEnv(Environment):
self.dones[i_agent] = True self.dones[i_agent] = True
agent.moving = False agent.moving = False
# TODO: Moving agents to arbitrary position # TODO: Moving agents to arbitrary position
agent.position = (i_agent, 0) agent.position = DEPOT_POSITION
agent.target = (i_agent, 0) agent.target = DEPOT_POSITION
else: else:
self.rewards_dict[i_agent] += self.step_penalty * agent.speed_data['speed'] self.rewards_dict[i_agent] += self.step_penalty * agent.speed_data['speed']
else: else:
......
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