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

randomized through path found

parent 3c12890c
No related branches found
No related tags found
No related merge requests found
......@@ -768,13 +768,15 @@ def sparse_rail_generator(num_cities=5, grid_mode=False, max_inter_city_rails=4,
for current_city in range(len(node_positions)):
all_outer_connection_points = [item for sublist in outer_connection_points[current_city] for item in
sublist]
city_boarder = _city_boarder(node_positions[current_city], node_radius)
for boarder in range(4):
random_boarders = np.random.choice(np.arange(4), 4, False)
# TODO: Only look at the relevant boarders (Only two at the moment)
for boarder in random_boarders:
for source in inner_connection_points[current_city][boarder]:
for other_boarder in range(4):
for other_boarder in random_boarders:
if boarder != other_boarder and len(inner_connection_points[current_city][other_boarder]) > 0:
for target in inner_connection_points[current_city][other_boarder]:
city_boarder = _city_boarder(node_positions[current_city], node_radius)
current_track = connect_cities(rail_trans, grid_map, source, target, city_boarder)
if target in all_outer_connection_points and source in \
all_outer_connection_points and len(through_path_cells[current_city]) < 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