Skip to content
Snippets Groups Projects
Commit 9b107a4c authored by Thomas's avatar Thomas
Browse files

increment sanity counter in complex rail generator

Increment the created_sanity counter when adding connections between rails to prevent the while loop to run indefinitely
parent c9b4f94b
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,9 @@ def complex_rail_generator(nr_start_goal=1, ...@@ -167,6 +167,9 @@ def complex_rail_generator(nr_start_goal=1,
if len(new_path) >= 2: if len(new_path) >= 2:
nr_created += 1 nr_created += 1
else:
# after too many failures we will give up
created_sanity += 1
return grid_map, {'agents_hints': { return grid_map, {'agents_hints': {
'start_goal': start_goal, 'start_goal': start_goal,
......
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