diff --git a/env_data/railway/complex_scene_2.pkl b/env_data/railway/complex_scene_2.pkl new file mode 100644 index 0000000000000000000000000000000000000000..8fa1d365f62078a72ee88aa199639100a53d0bea Binary files /dev/null and b/env_data/railway/complex_scene_2.pkl differ diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index 498392879da271a9ed481054d5ad5de23db49dd6..6c687667cc4fcc5dcd5035956af91b661e63b111 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -83,15 +83,12 @@ class PILGL(GraphicsLayer): self.background_grid = np.zeros(shape=(self.width, self.height)) for x in range(self.width): for y in range(self.height): - distance = None + distance = int(np.ceil(np.sqrt(self.width ** 2.0 + self.height ** 2.0))) for rc in dTargets: r = rc[1] c = rc[0] d = int(np.floor(np.sqrt((x - r) ** 2 + (y - c) ** 2))) - if distance is None: - distance = d - else: - distance = min(d, distance) + distance = min(d, distance) self.background_grid[x][y] = distance def rgb_s2i(self, sRGB): diff --git a/notebooks/complex_scene_2.pkl b/notebooks/complex_scene_2.pkl new file mode 100644 index 0000000000000000000000000000000000000000..8fa1d365f62078a72ee88aa199639100a53d0bea Binary files /dev/null and b/notebooks/complex_scene_2.pkl differ