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

fixed how nodes are connected. We don't set empty cells at beginning and end anymore.

This however requires that we run the fix script after setting paths.
parent 9bc21050
No related branches found
No related tags found
No related merge requests found
...@@ -32,15 +32,15 @@ speed_ration_map = {1.: 0.25, # Fast passenger train ...@@ -32,15 +32,15 @@ speed_ration_map = {1.: 0.25, # Fast passenger train
env = RailEnv(width=50, env = RailEnv(width=50,
height=50, height=50,
rail_generator=sparse_rail_generator(num_cities=10, # Number of cities in map (where train stations are) rail_generator=sparse_rail_generator(num_cities=5, # Number of cities in map (where train stations are)
num_intersections=0, # Number of intersections (no start / target) num_intersections=4, # Number of intersections (no start / target)
num_trainstations=100, # Number of possible start/targets on map num_trainstations=100, # Number of possible start/targets on map
min_node_dist=10, # Minimal distance of nodes min_node_dist=10, # Minimal distance of nodes
node_radius=4, # Proximity of stations to city center node_radius=4, # Proximity of stations to city center
num_neighb=3, # Number of connections to other cities/intersections num_neighb=2, # Number of connections to other cities/intersections
seed=15, # Random seed seed=15, # Random seed
grid_mode=True, grid_mode=True,
nr_inter_connections=1, nr_inter_connections=2,
max_nr_connection_points=12 max_nr_connection_points=12
), ),
schedule_generator=sparse_schedule_generator(), schedule_generator=sparse_schedule_generator(),
......
...@@ -45,7 +45,7 @@ def connect_basic_operation( ...@@ -45,7 +45,7 @@ def connect_basic_operation(
# need to flip direction because of how end points are defined # need to flip direction because of how end points are defined
new_trans = rail_trans.set_transition(new_trans, mirror(current_dir), new_dir, 1) new_trans = rail_trans.set_transition(new_trans, mirror(current_dir), new_dir, 1)
else: else:
new_trans = 0 new_trans = rail_trans.set_transition(new_trans, current_dir, new_dir, 1) # 0
else: else:
# into existing rail # into existing rail
new_trans = rail_trans.set_transition(new_trans, current_dir, new_dir, 1) new_trans = rail_trans.set_transition(new_trans, current_dir, new_dir, 1)
...@@ -65,7 +65,7 @@ def connect_basic_operation( ...@@ -65,7 +65,7 @@ def connect_basic_operation(
if flip_end_node_trans: if flip_end_node_trans:
new_trans_e = rail_trans.set_transition(new_trans_e, new_dir, mirror(new_dir), 1) new_trans_e = rail_trans.set_transition(new_trans_e, new_dir, mirror(new_dir), 1)
else: else:
new_trans_e = 0 new_trans_e = rail_trans.set_transition(new_trans, current_dir, new_dir, 1) #0
else: else:
# into existing rail # into existing rail
new_trans_e = rail_trans.set_transition(new_trans_e, new_dir, new_dir, 1) new_trans_e = rail_trans.set_transition(new_trans_e, new_dir, new_dir, 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