Skip to content
Snippets Groups Projects
Commit 3528da79 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

bug fix in generator

parent f159b27a
No related branches found
No related tags found
No related merge requests found
......@@ -733,7 +733,7 @@ def realistic_rail_generator(nr_start_goal=1, seed=0):
(x_offsets[off_set_loop] - 1, 0),
(x_offsets[off_set_loop] - 2, 0))
for nbr_track_loop in range(max_n_track_seg-1):
for nbr_track_loop in range(max_n_track_seg-1):
if len(data) < 2 * n_track_seg + 1:
break
x = np.sort(np.random.choice(data, 2 * n_track_seg, False)).astype(int)
......
......@@ -8,7 +8,7 @@ from flatland.utils.rendertools import RenderTool
import numpy as np
def test_realistic_rail_generator():
for test_loop in range(5):
for test_loop in range(20):
num_agents = np.random.randint(10,30)
env = RailEnv(width=np.random.randint(40,80),
height=np.random.randint(10,20),
......
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