Browse Source

make _gen_grid abstract

saleml 2 years ago
parent
commit
9f3e5e9055
1 changed files with 3 additions and 1 deletions
  1. 3 1
      gym_minigrid/minigrid.py

+ 3 - 1
gym_minigrid/minigrid.py

@@ -1,4 +1,5 @@
 import hashlib
+from abc import abstractmethod
 import math
 import string
 from enum import IntEnum
@@ -823,8 +824,9 @@ class MiniGridEnv(gym.Env):
 
         return str
 
+    @abstractmethod
     def _gen_grid(self, width, height):
-        assert False, "_gen_grid needs to be implemented by each environment"
+        pass
 
     def _reward(self):
         """