def reward_function(self, vehicle_id: str):
        """
        Compared to the original reward_function, we add goal-dependent reward to info dict.
        """
        vehicle = self.agents[vehicle_id]
        step_info = dict()

        # Compute goal-dependent reward and saved to step_info
        if self.config["use_multigoal_intersection"]:
            for goal_name in self.engine.goal_manager.goals.keys():
                navi = self.engine.goal_manager.get_navigation(goal_name)
                prefix = goal_name
                reward, route_completion = self._reward_per_navigation(vehicle, navi, goal_name)
                step_info[f"reward/goals/{prefix}"] = reward
                step_info[f"route_completion/goals/{prefix}"] = route_completion

        else:
            navi = vehicle.navigation
            goal_name = "default"
            reward, route_completion = self._reward_per_navigation(vehicle, navi, goal_name)
            step_info[f"reward/goals/{goal_name}"] = reward
            step_info[f"route_completion/goals/{goal_name}"] = route_completion

        default_reward, default_rc = self._reward_per_navigation(vehicle, vehicle.navigation, "default")
        step_info[f"reward/goals/default"] = default_reward
        step_info[f"route_completion/goals/default"] = default_rc
        step_info[f"reward/default_reward"] = default_reward
        step_info[f"route_completion"] = vehicle.navigation.route_completion

        return default_reward, step_info

        Compared to the original reward_function, we add goal-dependent reward to info dict.
        
metadrive/envs/multigoal_intersection.py