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

removing agent when they cannot be faced correctly

parent 1e163e03
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ action_dict = dict() ...@@ -91,7 +91,7 @@ action_dict = dict()
print("Start episode...") print("Start episode...")
# Reset environment and get initial observations for all agents # Reset environment and get initial observations for all agents
obs = env.reset() obs = env.reset()
print(env.get_num_agents(), )
# Reset the rendering sytem # Reset the rendering sytem
env_renderer.reset() env_renderer.reset()
......
...@@ -89,10 +89,17 @@ def sparse_schedule_generator(speed_ratio_map: Mapping[float, float] = None) -> ...@@ -89,10 +89,17 @@ def sparse_schedule_generator(speed_ratio_map: Mapping[float, float] = None) ->
track_to_use = 0 track_to_use = 0
else: else:
track_to_use = 1 track_to_use = 1
for i in range(len(start_slots[current_start_node])): for i in range(len(start_slots[current_start_node])):
if start_slots[current_start_node][i][1] == track_to_use: if start_slots[current_start_node][i][1] == track_to_use:
start_station_idx = i start_station_idx = i
break break
else:
start_station_idx = None
if start_station_idx is None:
warnings.warn("No slot available with required start orientation")
continue
start = start_slots[current_start_node][start_station_idx] start = start_slots[current_start_node][start_station_idx]
start_slots[current_start_node].pop(start_station_idx) start_slots[current_start_node].pop(start_station_idx)
......
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