def done_function(self, vehicle_id: str):
        """
        Compared to MetaDriveEnv's done_function, we add more stats here to record which goal is arrived.
        """
        done, done_info = super(MultiGoalIntersectionEnvBase, self).done_function(vehicle_id)
        vehicle = self.agents[vehicle_id]

        if self.config["use_multigoal_intersection"]:
            for goal_name in self.engine.goal_manager.goals.keys():
                done_info[f"arrive_dest/goals/{goal_name}"] = self._is_arrive_destination(vehicle, goal_name)

        else:
            done_info[f"arrive_dest/goals/default"] = done

        done_info["arrive_dest/goals/default"] = self._is_arrive_destination(vehicle, "default")

        return done, done_info

        Compared to MetaDriveEnv's done_function, we add more stats here to record which goal is arrived.
        
metadrive/envs/multigoal_intersection.py