def _check_erroneous_box_opening()

in data/envs/babyai/bot_agent.py [0:0]


    def _check_erroneous_box_opening(self, action):
        """
        When the agent opens a box, we raise an error and mark the task unsolvable.
        This is a tad conservative, because maybe the box is irrelevant to the mission.unwrapped.
        """
        if (
            action == self.mission.unwrapped.actions.toggle
            and self.prev_fwd_cell is not None
            and self.prev_fwd_cell.type == "box"
        ):
            raise DisappearedBoxError("A box was opened. I am not sure I can help now.")