SkippedShipment
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
指定解決方案中未執行出貨作業的詳細資料。如果是常見情況,且/或如果能夠找出造成略過的原因,我們就會在這裡回報原因。
JSON 表示法 |
{
"index": integer,
"label": string,
"reasons": [
{
object (Reason )
}
]
} |
欄位 |
index |
integer
這個索引對應到來源 ShipmentModel 中的運送索引。
|
label |
string
對應的 Shipment.label 副本 (如果在 Shipment 中指定)。
|
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 content defines the structure and details of skipped shipments in a solution, including the reasons they were not performed.\u003c/p\u003e\n"],["\u003cp\u003eEach skipped shipment's JSON representation includes an index, label, and a list of reasons explaining why it was skipped, with details on the \u003ccode\u003eindex\u003c/code\u003e and \u003ccode\u003elabel\u003c/code\u003e fields.\u003c/p\u003e\n"],["\u003cp\u003eThe "Reason" section details how reasons for skipping are documented, including \u003ccode\u003ecode\u003c/code\u003e, \u003ccode\u003eexampleExceededCapacityType\u003c/code\u003e, and \u003ccode\u003eexampleVehicleIndex\u003c/code\u003e, which provide specific information about the incompatibility.\u003c/p\u003e\n"],["\u003cp\u003eThe "Code" section lists various enum reasons for skipped shipments, such as \u003ccode\u003eDEMAND_EXCEEDS_VEHICLE_CAPACITY\u003c/code\u003e, \u003ccode\u003eNO_VEHICLE\u003c/code\u003e and \u003ccode\u003eCANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT\u003c/code\u003e, each explaining a different cause.\u003c/p\u003e\n"],["\u003cp\u003eIf a reason applies to multiple vehicles, it will be listed multiple times with a unique \u003ccode\u003eexampleVehicleIndex\u003c/code\u003e for each vehicle, and a skipped shipment will not have duplicate 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/u-turn-avoidance/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/u-turn-avoidance/reference/rest/v1/ShipmentModel#Shipment.FIELDS.label), if specified in the `Shipment`. |\n| `reasons[]` | `object (`[Reason](/maps/tt/route-optimization/experimental/u-turn-avoidance/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/u-turn-avoidance/reference/rest/v1/SkippedShipment#Code), \"exampleExceededCapacityType\": string, \"exampleVehicleIndex\": integer } ``` |\n\n| Fields ||\n|-------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code` | `enum (`[Code](/maps/tt/route-optimization/experimental/u-turn-avoidance/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. |"]]