From 62b3fbd053e2182ddb252de590df419baadedcce Mon Sep 17 00:00:00 2001
From: u229589 <christian.baumberger@sbb.ch>
Date: Tue, 22 Oct 2019 11:40:50 +0200
Subject: [PATCH] implement review points

---
 changelog.md                   | 4 ++--
 docs/specifications/railway.md | 2 ++
 flatland/envs/rail_env.py      | 9 +++------
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/changelog.md b/changelog.md
index 1099488b..faca0cb8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -9,10 +9,10 @@ Changes since Flatland 2.0.0
 
 ### Changes in rail generator and `RailEnv`
 - renaming of `distance_maps` into `distance_map`
-- by default the reset method of RailEnv is not called in the constructor of RailEnv anymore. Therefore the reset method needs to be called after the creation of a RailEnv object
+- by default the reset method of RailEnv is not called in the constructor of RailEnv anymore (compliance for OpenAI Gym). Therefore the reset method needs to be called after the creation of a RailEnv object
 
 ### Changes in schedule generation
-- return value of schedule generator has changed to the named tuple `Schedule`
+- return value of schedule generator has changed to the named tuple `Schedule`. From the point of view of a consumer, nothing has changed, this is just a type hint which is introduced where the attributes of `Schedule` have names.
 
 Changes since Flatland 1.0.0
 --------------------------
diff --git a/docs/specifications/railway.md b/docs/specifications/railway.md
index 3623ea45..e1ee77f4 100644
--- a/docs/specifications/railway.md
+++ b/docs/specifications/railway.md
@@ -711,3 +711,5 @@ RailEnv._max_episode_steps = timedelay_factor * alpha * (env.width + env.height
 ```
 
 where the following default values are used `timedelay_factor=4`, `alpha=2` and `ratio_nr_agents_to_nr_cities=20`
+
+If participants want to use their own formula they have to overwrite the method `compute_max_episode_steps()` from the class `RailEnv`
diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index bd1920ac..1dc24aff 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -250,8 +250,7 @@ class RailEnv(Environment):
         self.agents = EnvAgent.list_from_static(self.agents_static)
 
     @staticmethod
-    def compute_max_episode_steps(width: int, height: int, timedelay_factor: int = 4, alpha: int = 2,
-                                  ratio_nr_agents_to_nr_cities: float = 20.0) -> int:
+    def compute_max_episode_steps(width: int, height: int, ratio_nr_agents_to_nr_cities: float = 20.0) -> int:
         """
         compute_max_episode_steps(width, height, ratio_nr_agents_to_nr_cities, timedelay_factor, alpha)
 
@@ -265,10 +264,6 @@ class RailEnv(Environment):
             height of environment
         ratio_nr_agents_to_nr_cities : float, optional
             number_of_agents/number_of_cities
-        timedelay_factor : int, optional
-            timedelay_factor
-        alpha : int, optional
-            alpha
 
         Returns
         -------
@@ -276,6 +271,8 @@ class RailEnv(Environment):
             maximum number of episode steps
 
         """
+        timedelay_factor = 4
+        alpha = 2
         return int(timedelay_factor * alpha * (width + height + ratio_nr_agents_to_nr_cities))
 
     def reset(self, regen_rail=True, replace_agents=True, activate_agents=False, random_seed=None):
-- 
GitLab