From 7220283653073be38473f0a3dd775b23f7eadc72 Mon Sep 17 00:00:00 2001 From: Zach Dwiel Date: Wed, 10 Oct 2018 16:17:28 -0400 Subject: [PATCH] add len(Episode) --- rl_coach/core_types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rl_coach/core_types.py b/rl_coach/core_types.py index 33c7f67..6d6bfe4 100644 --- a/rl_coach/core_types.py +++ b/rl_coach/core_types.py @@ -638,6 +638,9 @@ class Episode(object): def length(self): return self._length + def __len__(self): + return self.length() + def get_transition(self, transition_idx): return self.transitions[transition_idx]