SkippedShipment
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
指定解決方案中未執行出貨作業的詳細資料。對於簡單的情況和/或我們能夠找出略過的原因,我們會在此處回報原因。
JSON 表示法 |
{
"index": integer,
"label": string,
"reasons": [
{
object (Reason )
}
]
} |
欄位 |
index |
integer
這個索引對應到來源 ShipmentModel 中的運送索引。
|
label |
string
如果 Shipment 中指定了對應的 Shipment.label ,則會複製該 Shipment.label 。
|
reasons[] |
object (Reason )
列出略過運送的原因。請參閱 Reason 上方的留言。如果我們無法瞭解訂單遭到略過的原因,就不會設定原因。
|
原因
如果我們可以說明出貨作業未完成的原因,會列在這個頁面。如果所有車輛的原因不同,reason
就會有多個元素。跳過的出貨單不得有重複的原因,也就是說,除了 exampleVehicleIndex
以外,所有欄位都必須相同。範例:
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
exampleVehicleIndex: 1
exampleExceededCapacityType: "Apples"
}
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
exampleVehicleIndex: 3
exampleExceededCapacityType: "Pears"
}
reasons {
code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
exampleVehicleIndex: 1
}
跳過的運送作業與所有車輛都不相容。每輛車輛的原因可能不同,但至少有一輛車輛的「蘋果」容量會超出 (包括車輛 1)、至少有一輛車輛的「梨」容量會超出 (包括車輛 3),且至少有一輛車輛的距離限制會超出 (包括車輛 1)。
JSON 表示法 |
{
"code": enum (Code ),
"exampleExceededCapacityType": string,
"exampleVehicleIndex": integer
} |
欄位 |
code |
enum (Code )
請參閱程式碼的註解。
|
exampleExceededCapacityType |
string
如果原因代碼為 DEMAND_EXCEEDS_VEHICLE_CAPACITY ,請記錄超出容量的一種容量類型。
|
exampleVehicleIndex |
integer
如果原因與貨運車輛不相容,這個欄位會提供一輛相關車輛的索引。
|
程式碼
指出原因類型的代碼。這裡的順序沒有意義。請特別注意,如果兩個條件都符合,標準無法判斷解決方案中的某個原因是否會顯示在另一個解決方案的前面。
列舉 |
CODE_UNSPECIFIED |
請勿使用此值。 |
NO_VEHICLE |
模型中沒有車輛,因此無法運送所有貨物。 |
DEMAND_EXCEEDS_VEHICLE_CAPACITY |
運送需求超過車輛對某些容量類型的上限,例如 exampleExceededCapacityType 。 |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT |
執行這項出貨作業所需的最短距離,亦即從車輛的 startLocation 到貨運的上車和/或送貨地點,以及車輛終點位置超過車輛的 routeDistanceLimit 。 請注意,我們會使用大地測量距離進行這項計算。 |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT |
執行這項送貨作業所需的最短時間,包括交通時間、等待時間和服務時間超過車輛的 routeDurationLimit 。 注意:系統會以最佳情況計算交通時間,也就是測地距離 x 36 公尺/秒 (約 130 公里/小時)。 |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT |
與上述相同,但系統只會比較最短交通時間和車輛的 travelDurationLimit 。 |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS |
如果車輛在最早的開始時間開始運送,則在最佳情況下 (請參閱 CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT 瞭解時間計算方式),車輛將無法執行這項運送作業:總時間會讓車輛在最晚的結束時間過後才結束。 |
VEHICLE_NOT_ALLOWED |
貨件的 allowedVehicleIndices 欄位並非空白,且這輛車輛不屬於該貨件。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eThis document details the structure for reporting reasons why shipments were skipped in a solution, focusing on cases where the cause can be identified.\u003c/p\u003e\n"],["\u003cp\u003eSkipped shipment data includes an index, label, and a list of \u003ccode\u003ereasons\u003c/code\u003e, each \u003ccode\u003ereason\u003c/code\u003e explaining why the shipment couldn't be performed.\u003c/p\u003e\n"],["\u003cp\u003eReasons for skipped shipments include exceeding vehicle capacity, distance limits, duration limits, time window constraints, or not being in the allowed vehicles for the shipment.\u003c/p\u003e\n"],["\u003cp\u003eEach reason contains a \u003ccode\u003ecode\u003c/code\u003e specifying the type of issue, and \u003ccode\u003eexampleVehicleIndex\u003c/code\u003e or \u003ccode\u003eexampleExceededCapacityType\u003c/code\u003e that is present if the issue is vehicle related or exceeds capacity.\u003c/p\u003e\n"],["\u003cp\u003eThe provided structure outlines how to represent these \u003ccode\u003ereasons\u003c/code\u003e in JSON format, including relevant fields and their data types for both the skipped shipment itself and the associated reasons.\u003c/p\u003e\n"]]],[],null,["# SkippedShipment\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Reason](#Reason)\n - [JSON representation](#Reason.SCHEMA_REPRESENTATION)\n- [Code](#Code)\n\nSpecifies details of unperformed shipments in a solution. For trivial cases and/or if we are able to identify the cause for skipping, we report the reason here.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"index\": integer, \"label\": string, \"reasons\": [ { object (/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/SkippedShipment#Reason) } ] } ``` |\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `index` | `integer` The index corresponds to the index of the shipment in the source `ShipmentModel`. |\n| `label` | `string` Copy of the corresponding [Shipment.label](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/ShipmentModel#Shipment.FIELDS.label), if specified in the `Shipment`. |\n| `reasons[]` | `object (`[Reason](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/SkippedShipment#Reason)`)` A list of reasons that explain why the shipment was skipped. See comment above `Reason`. If we are unable to understand why a shipment was skipped, reasons will not be set. |\n\nReason\n------\n\nIf we can explain why the shipment was skipped, reasons will be listed here. If the reason is not the same for all vehicles, `reason` will have more than 1 element. A skipped shipment cannot have duplicate reasons, i.e. where all fields are the same except for `exampleVehicleIndex`. Example: \n\n reasons {\n code: DEMAND_EXCEEDS_VEHICLE_CAPACITY\n exampleVehicleIndex: 1\n exampleExceededCapacityType: \"Apples\"\n }\n reasons {\n code: DEMAND_EXCEEDS_VEHICLE_CAPACITY\n exampleVehicleIndex: 3\n exampleExceededCapacityType: \"Pears\"\n }\n reasons {\n code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT\n exampleVehicleIndex: 1\n }\n\nThe skipped shipment is incompatible with all vehicles. The reasons may be different for all vehicles but at least one vehicle's \"Apples\" capacity would be exceeded (including vehicle 1), at least one vehicle's \"Pears\" capacity would be exceeded (including vehicle 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1).\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"code\": enum (/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/SkippedShipment#Code), \"exampleExceededCapacityType\": string, \"exampleVehicleIndex\": integer } ``` |\n\n| Fields ||\n|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `enum (`[Code](/maps/tt/route-optimization/experimental/load-cost/reference/rest/v1/SkippedShipment#Code)`)` Refer to the comments of Code. |\n| `exampleExceededCapacityType` | `string` If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one capacity type that is exceeded. |\n| `exampleVehicleIndex` | `integer` If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle. |\n\nCode\n----\n\nCode identifying the reason type. The order here is meaningless. In particular, it gives no indication of whether a given reason will appear before another in the solution, if both apply.\n\n| Enums ||\n|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CODE_UNSPECIFIED` | This should never be used. |\n| `NO_VEHICLE` | There is no vehicle in the model making all shipments infeasible. |\n| `DEMAND_EXCEEDS_VEHICLE_CAPACITY` | The demand of the shipment exceeds a vehicle's capacity for some capacity types, one of which is `exampleExceededCapacityType`. |\n| `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT` | The minimum distance necessary to perform this shipment, i.e. from the vehicle's `startLocation` to the shipment's pickup and/or delivery locations and to the vehicle's end location exceeds the vehicle's `routeDistanceLimit`. Note that for this computation we use the geodesic distances. |\n| `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` | The minimum time necessary to perform this shipment, including travel time, wait time and service time exceeds the vehicle's `routeDurationLimit`. Note: travel time is computed in the best-case scenario, namely as geodesic distance x 36 m/s (roughly 130 km/hour). |\n| `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT` | Same as above but we only compare minimum travel time and the vehicle's `travelDurationLimit`. |\n| `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS` | The vehicle cannot perform this shipment in the best-case scenario (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time computation) if it starts at its earliest start time: the total time would make the vehicle end after its latest end time. |\n| `VEHICLE_NOT_ALLOWED` | The `allowedVehicleIndices` field of the shipment is not empty and this vehicle does not belong to it. |"]]