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()
print("Start episode...")
# Reset environment and get initial observations for all agents
obs = env.reset()
print(env.get_num_agents(), )
# Reset the rendering sytem
env_renderer.reset()
......
......@@ -89,10 +89,17 @@ def sparse_schedule_generator(speed_ratio_map: Mapping[float, float] = None) ->
track_to_use = 0
else:
track_to_use = 1
for i in range(len(start_slots[current_start_node])):
if start_slots[current_start_node][i][1] == track_to_use:
start_station_idx = i
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_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