def before_reset(self):
        """
        Update episode level config to this manager and clean element or detach element
        """
        self.clear_objects([object_id for object_id in self.spawned_objects.keys()])
        self.spawned_objects = {}

        Update episode level config to this manager and clean element or detach element
        
metadrive/manager/base_manager.py