From 71a41765dedb7d1d1f26b84d10aa66e88832bb9d Mon Sep 17 00:00:00 2001
From: "S.P. Mohanty" <spmohanty91@gmail.com>
Date: Thu, 24 Oct 2019 18:28:18 +0200
Subject: [PATCH] Regenerate the schedule when regenerating rails too

---
 flatland/envs/rail_env.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index 3cb38c16..8cbab637 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -321,7 +321,7 @@ class RailEnv(Environment):
 
         # todo change self.agents_static[0] with the refactoring for agents_static -> issue nr. 185
         # https://gitlab.aicrowd.com/flatland/flatland/issues/185
-        if regenerate_schedule or self.agents_static[0] is None:
+        if regenerate_schedule or regenerate_rail or self.agents_static[0] is None:
             agents_hints = None
             if optionals and 'agents_hints' in optionals:
                 agents_hints = optionals['agents_hints']
-- 
GitLab