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

check for feasibility

parent 31883bc7
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ env = RailEnv(width=50,
max_tracks_in_city=4,
),
schedule_generator=sparse_schedule_generator(),
number_of_agents=10,
number_of_agents=100,
stochastic_data=stochastic_data, # Malfunction data generator
obs_builder_object=GlobalObsForRailEnv(),
remove_agents_at_target=True
......
......@@ -82,7 +82,8 @@ def sparse_schedule_generator(speed_ratio_map: Mapping[float, float] = None) ->
agent_orientation = (agent_start_targets_nodes[agent_idx][2] + 2 * start[1]) % 4
if not rail.check_path_exists(start[0], agent_orientation, target[0]):
agent_orientation = (agent_orientation + 2) % 4
print(rail.check_path_exists(start[0], agent_orientation, target[0]))
if not (rail.check_path_exists(start[0], agent_orientation, target[0])):
print("Infeasible")
agents_position.append((start[0][0], start[0][1]))
agents_target.append((target[0][0], target[0][1]))
......
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