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 字段不为空,而此车辆不属于该订单。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):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. |"]]