From 26dcea5111f74f9d4221685b0d60aa6de2ba7276 Mon Sep 17 00:00:00 2001
From: Tue Herlau <tuhe@dtu.dk>
Date: Tue, 18 Feb 2025 10:59:41 +0100
Subject: [PATCH] Fixed problem that only affect in class visualizations

---
 irlc/ex01/agent.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/irlc/ex01/agent.py b/irlc/ex01/agent.py
index 6cca61a..1b27748 100644
--- a/irlc/ex01/agent.py
+++ b/irlc/ex01/agent.py
@@ -306,7 +306,7 @@ def train(env,
                 if done or steps >= max_steps:
                     trajectory.state.append(sp)
                     trajectory.env_info.append(info_sp)
-                    trajectory.time.append(np.asarray(info_sp['time_seconds'] if 'time_seconds' in info_s else steps))
+                    trajectory.time.append(np.asarray(info_sp.get('time_seconds', None) if 'time_seconds' in info_s else steps))
                     break_outer = steps >= max_steps
                     break
                 s = sp 
-- 
GitLab