Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trường này chỉ định một trong những giả định sau đây để sử dụng khi tính toán thời gian di chuyển trong điều kiện giao thông, được trình bày trong các enum bên dưới. Tuỳ thuộc vào enum được chọn, trường duration của phản hồi TrafficModel sẽ thay đổi. Giá trị này chứa thời gian dự đoán để đến đích trong điều kiện giao thông, dựa trên mức trung bình trong quá khứ. TrafficModel chỉ dành cho những yêu cầu đã đặt RoutingPreference thành TRAFFIC_AWARE_OPTIMAL và RouteTravelMode thành DRIVE.
Enum
TRAFFIC_MODEL_UNSPECIFIED
Không sử dụng. Nếu được chỉ định, giá trị mặc định sẽ là BEST_GUESS.
BEST_GUESS
Cho biết rằng duration được trả về phải là thông tin ước tính chính xác nhất về thời gian di chuyển dựa trên những thông tin đã biết về cả tình trạng giao thông trong quá khứ và tình trạng giao thông trực tiếp. Thông tin giao thông trực tiếp càng quan trọng hơn khi departureTime càng gần với thời điểm hiện tại.
PESSIMISTIC
Cho biết thời lượng được trả về phải dài hơn thời gian di chuyển thực tế trong hầu hết các ngày, mặc dù đôi khi có những ngày điều kiện giao thông đặc biệt xấu có thể vượt quá giá trị này.
OPTIMISTIC
Cho biết rằng thời lượng được trả về phải ngắn hơn thời gian di chuyển thực tế trong hầu hết các ngày, mặc dù đôi khi có những ngày điều kiện giao thông đặc biệt thuận lợi có thể nhanh hơn giá trị này.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eduration\u003c/code\u003e field provides estimated travel time influenced by the \u003ccode\u003etraffic_model\u003c/code\u003e setting.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etraffic_model\u003c/code\u003e options include \u003ccode\u003eBEST_GUESS\u003c/code\u003e (default), \u003ccode\u003ePESSIMISTIC\u003c/code\u003e, and \u003ccode\u003eOPTIMISTIC\u003c/code\u003e, impacting travel time predictions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBEST_GUESS\u003c/code\u003e considers historical and live traffic data for travel time estimation, with live traffic having more impact closer to departure.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePESSIMISTIC\u003c/code\u003e and \u003ccode\u003eOPTIMISTIC\u003c/code\u003e offer durations longer and shorter than actual travel times on most days, respectively, accounting for traffic variations.\u003c/p\u003e\n"]]],["The core content outlines how to specify traffic-based time calculations, impacting the `duration` field. The `TRAFFIC_MODEL_UNSPECIFIED` defaults to `BEST_GUESS`, which uses historical and live data to estimate travel time. `PESSIMISTIC` calculates a longer travel time, likely exceeded only in severe conditions. Conversely, `OPTIMISTIC` calculates a shorter time, potentially beaten during favorable conditions. These options modify the estimated duration by factoring in historical traffic data and real-time conditions.\n"],null,["# TrafficModel\n\nSpecifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the `duration` field in the response, which contains the predicted time in traffic based on historical averages.\n\n| Enums ||\n|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `TRAFFIC_MODEL_UNSPECIFIED` | Unused. If specified, will default to `BEST_GUESS`. |\n| `BEST_GUESS` | Indicates that the returned `duration` should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the `departureTime` is to now. |\n| `PESSIMISTIC` | Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value. |\n| `OPTIMISTIC` | Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value. |"]]