From 9612f27fb601710b627d059dfb66e504fbd6f010 Mon Sep 17 00:00:00 2001
From: nimishsantosh107 <nimishsantosh107@icloud.com>
Date: Thu, 26 Aug 2021 12:52:20 +0300
Subject: [PATCH] cancellation_time_buffer used

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

diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index 4cd1d2d4..5a9e88da 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -495,7 +495,7 @@ class RailEnv(Environment):
             # CANCELLED check (never departed)
             if (agent.status == RailAgentStatus.READY_TO_DEPART):
                 reward = -1 * self.cancellation_factor * \
-                    (agent.get_travel_time_on_shortest_path(self.distance_map) + 0)  # 0 replaced with buffer
+                    (agent.get_travel_time_on_shortest_path(self.distance_map) + self.cancellation_time_buffer)
 
             # Departed but never reached
             if (agent.status == RailAgentStatus.ACTIVE):
@@ -591,7 +591,6 @@ class RailEnv(Environment):
             
             for i_agent, agent in enumerate(self.agents):
                 
-                # agent done? (arrival_time is not None)
                 reward = self._handle_end_reward(agent)
                 self.rewards_dict[i_agent] += reward
                 
-- 
GitLab