google-cloud-optimization-v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2755 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Optimization
23
+ module V1
24
+ # Request to be given to a tour optimization solver which defines the
25
+ # shipment model to solve as well as optimization parameters.
26
+ # @!attribute [rw] parent
27
+ # @return [::String]
28
+ # Required. Target project and location to make a call.
29
+ #
30
+ # Format: `projects/{project-id}/locations/{location-id}`.
31
+ #
32
+ # If no location is specified, a region will be chosen automatically.
33
+ # @!attribute [rw] timeout
34
+ # @return [::Google::Protobuf::Duration]
35
+ # If this timeout is set, the server returns a response before the timeout
36
+ # period has elapsed or the server deadline for synchronous requests is
37
+ # reached, whichever is sooner.
38
+ #
39
+ # For asynchronous requests, the server will generate a solution (if
40
+ # possible) before the timeout has elapsed.
41
+ # @!attribute [rw] model
42
+ # @return [::Google::Cloud::Optimization::V1::ShipmentModel]
43
+ # Shipment model to solve.
44
+ # @!attribute [rw] solving_mode
45
+ # @return [::Google::Cloud::Optimization::V1::OptimizeToursRequest::SolvingMode]
46
+ # By default, the solving mode is `DEFAULT_SOLVE` (0).
47
+ # @!attribute [rw] max_validation_errors
48
+ # @return [::Integer]
49
+ # Truncates the number of validation errors returned. Those errors are
50
+ # typically attached to an INVALID_ARGUMENT error payload as a BadRequest
51
+ # error detail (https://cloud.google.com/apis/design/errors#error_details),
52
+ # unless solving_mode=VALIDATE_ONLY: see the
53
+ # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
54
+ # field.
55
+ # This defaults to 100 and is capped at 10,000.
56
+ # @!attribute [rw] search_mode
57
+ # @return [::Google::Cloud::Optimization::V1::OptimizeToursRequest::SearchMode]
58
+ # Search mode used to solve the request.
59
+ # @!attribute [rw] injected_first_solution_routes
60
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>]
61
+ # Guide the optimization algorithm in finding a first solution that is
62
+ # similar to a previous solution.
63
+ #
64
+ # The model is constrained when the first solution is built.
65
+ # Any shipments not performed on a route are implicitly skipped in the first
66
+ # solution, but they may be performed in successive solutions.
67
+ #
68
+ # The solution must satisfy some basic validity assumptions:
69
+ #
70
+ # * for all routes, `vehicle_index` must be in range and not be duplicated.
71
+ # * for all visits, `shipment_index` and `visit_request_index` must be
72
+ # in range.
73
+ # * a shipment may only be referenced on one route.
74
+ # * the pickup of a pickup-delivery shipment must be performed before
75
+ # the delivery.
76
+ # * no more than one pickup alternative or delivery alternative of
77
+ # a shipment may be performed.
78
+ # * for all routes, times are increasing (i.e., `vehicle_start_time
79
+ # <= visits[0].start_time <= visits[1].start_time ...
80
+ # <= vehicle_end_time`).
81
+ # * a shipment may only be performed on a vehicle that is allowed. A
82
+ # vehicle is allowed if {::Google::Cloud::Optimization::V1::Shipment#allowed_vehicle_indices Shipment.allowed_vehicle_indices} is empty or
83
+ # its `vehicle_index` is included in
84
+ # {::Google::Cloud::Optimization::V1::Shipment#allowed_vehicle_indices Shipment.allowed_vehicle_indices}.
85
+ #
86
+ # If the injected solution is not feasible, a validation error is not
87
+ # necessarily returned and an error indicating infeasibility may be returned
88
+ # instead.
89
+ # @!attribute [rw] injected_solution_constraint
90
+ # @return [::Google::Cloud::Optimization::V1::InjectedSolutionConstraint]
91
+ # Constrain the optimization algorithm to find a final solution that is
92
+ # similar to a previous solution. For example, this may be used to freeze
93
+ # portions of routes which have already been completed or which are to be
94
+ # completed but must not be modified.
95
+ #
96
+ # If the injected solution is not feasible, a validation error is not
97
+ # necessarily returned and an error indicating infeasibility may be returned
98
+ # instead.
99
+ # @!attribute [rw] refresh_details_routes
100
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>]
101
+ # If non-empty, the given routes will be refreshed, without modifying their
102
+ # underlying sequence of visits or travel times: only other details will be
103
+ # updated. This does not solve the model.
104
+ #
105
+ # As of 2020/11, this only populates the polylines of non-empty routes and
106
+ # requires that `populate_polylines` is true.
107
+ #
108
+ # The `route_polyline` fields of the passed-in routes may be inconsistent
109
+ # with route `transitions`.
110
+ #
111
+ # This field must not be used together with `injected_first_solution_routes`
112
+ # or `injected_solution_constraint`.
113
+ #
114
+ # `Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior.
115
+ # Polylines are still populated between all visits in all non-empty routes
116
+ # regardless of whether the related shipments or vehicles are ignored.
117
+ # @!attribute [rw] interpret_injected_solutions_using_labels
118
+ # @return [::Boolean]
119
+ # If true:
120
+ #
121
+ # * uses {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_label ShipmentRoute.vehicle_label} instead of `vehicle_index` to
122
+ # match routes in an injected solution with vehicles in the request;
123
+ # reuses the mapping of original {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index ShipmentRoute.vehicle_index} to new
124
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index ShipmentRoute.vehicle_index} to update
125
+ # {::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation#vehicle_indices ConstraintRelaxation.vehicle_indices}
126
+ # if non-empty, but the mapping must be unambiguous (i.e., multiple
127
+ # `ShipmentRoute`s must not share the same original `vehicle_index`).
128
+ # * uses {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#shipment_label ShipmentRoute.Visit.shipment_label} instead of `shipment_index`
129
+ # to match visits in an injected solution with shipments in the request;
130
+ # * uses {::Google::Cloud::Optimization::V1::SkippedShipment#label SkippedShipment.label} instead of {::Google::Cloud::Optimization::V1::SkippedShipment#index SkippedShipment.index} to
131
+ # match skipped shipments in the injected solution with request
132
+ # shipments.
133
+ #
134
+ # This interpretation applies to the `injected_first_solution_routes`,
135
+ # `injected_solution_constraint`, and `refresh_details_routes` fields.
136
+ # It can be used when shipment or vehicle indices in the request have
137
+ # changed since the solution was created, perhaps because shipments or
138
+ # vehicles have been removed from or added to the request.
139
+ #
140
+ # If true, labels in the following categories must appear at most once in
141
+ # their category:
142
+ #
143
+ # * {::Google::Cloud::Optimization::V1::Vehicle#label Vehicle.label} in the request;
144
+ # * {::Google::Cloud::Optimization::V1::Shipment#label Shipment.label} in the request;
145
+ # * {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_label ShipmentRoute.vehicle_label} in the injected solution;
146
+ # * {::Google::Cloud::Optimization::V1::SkippedShipment#label SkippedShipment.label} and {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#shipment_label ShipmentRoute.Visit.shipment_label} in
147
+ # the injected solution (except pickup/delivery visit pairs, whose
148
+ # `shipment_label` must appear twice).
149
+ #
150
+ # If a `vehicle_label` in the injected solution does not correspond to a
151
+ # request vehicle, the corresponding route is removed from the solution
152
+ # along with its visits. If a `shipment_label` in the injected solution does
153
+ # not correspond to a request shipment, the corresponding visit is removed
154
+ # from the solution. If a {::Google::Cloud::Optimization::V1::SkippedShipment#label SkippedShipment.label} in the injected solution
155
+ # does not correspond to a request shipment, the `SkippedShipment` is removed
156
+ # from the solution.
157
+ #
158
+ # Removing route visits or entire routes from an injected solution may
159
+ # have an effect on the implied constraints, which may lead to change in
160
+ # solution, validation errors, or infeasibility.
161
+ #
162
+ # NOTE: The caller must ensure that each {::Google::Cloud::Optimization::V1::Vehicle#label Vehicle.label}
163
+ # (resp. {::Google::Cloud::Optimization::V1::Shipment#label Shipment.label}) uniquely identifies a vehicle (resp. shipment)
164
+ # entity used across the two relevant requests: the past request that
165
+ # produced the `OptimizeToursResponse` used in the injected solution and the
166
+ # current request that includes the injected solution. The uniqueness checks
167
+ # described above are not enough to guarantee this requirement.
168
+ # @!attribute [rw] consider_road_traffic
169
+ # @return [::Boolean]
170
+ # Consider traffic estimation in calculating `ShipmentRoute` fields
171
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#travel_duration Transition.travel_duration},
172
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#start_time Visit.start_time},
173
+ # and `vehicle_end_time`; in setting the
174
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#has_traffic_infeasibilities ShipmentRoute.has_traffic_infeasibilities} field, and in calculating the
175
+ # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#total_cost OptimizeToursResponse.total_cost} field.
176
+ # @!attribute [rw] populate_polylines
177
+ # @return [::Boolean]
178
+ # If true, polylines will be populated in response `ShipmentRoute`s.
179
+ # @!attribute [rw] populate_transition_polylines
180
+ # @return [::Boolean]
181
+ # If true, polylines will be populated in response
182
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#transitions ShipmentRoute.transitions}.
183
+ # Note that in this case, the polylines will also be populated in the
184
+ # deprecated `travel_steps`.
185
+ # @!attribute [rw] allow_large_deadline_despite_interruption_risk
186
+ # @return [::Boolean]
187
+ # If this is set, then the request can have a deadline
188
+ # (see https://grpc.io/blog/deadlines) of up to 60 minutes.
189
+ # Otherwise, the maximum deadline is only 30 minutes.
190
+ # Note that long-lived requests have a significantly larger (but still small)
191
+ # risk of interruption.
192
+ # @!attribute [rw] use_geodesic_distances
193
+ # @return [::Boolean]
194
+ # If true, travel distances will be computed using geodesic distances instead
195
+ # of Google Maps distances, and travel times will be computed using geodesic
196
+ # distances with a speed defined by `geodesic_meters_per_second`.
197
+ # @!attribute [rw] geodesic_meters_per_second
198
+ # @return [::Float]
199
+ # When `use_geodesic_distances` is true, this field must be set and defines
200
+ # the speed applied to compute travel times. Its value must be at least 1.0
201
+ # meters/seconds.
202
+ # @!attribute [rw] label
203
+ # @return [::String]
204
+ # Label that may be used to identify this request, reported back in the
205
+ # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#request_label OptimizeToursResponse.request_label}.
206
+ # @!attribute [rw] populate_travel_step_polylines
207
+ # @return [::Boolean]
208
+ # Deprecated: Use [OptimizeToursRequest.populate_transition_polylines][] instead.
209
+ # If true, polylines will be populated in response
210
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#transitions ShipmentRoute.transitions}. Note that in this case, the polylines will
211
+ # also be populated in the deprecated `travel_steps`.
212
+ class OptimizeToursRequest
213
+ include ::Google::Protobuf::MessageExts
214
+ extend ::Google::Protobuf::MessageExts::ClassMethods
215
+
216
+ # Defines how the solver should handle the request. In all modes but
217
+ # `VALIDATE_ONLY`, if the request is invalid, you will receive an
218
+ # `INVALID_REQUEST` error. See {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors} to cap the number of
219
+ # errors returned.
220
+ module SolvingMode
221
+ # Solve the model.
222
+ DEFAULT_SOLVE = 0
223
+
224
+ # Only validates the model without solving it: populates as many
225
+ # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
226
+ # as possible.
227
+ VALIDATE_ONLY = 1
228
+
229
+ # Only populates
230
+ # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
231
+ # and doesn't actually solve the rest of the request (`status` and `routes`
232
+ # are unset in the response).
233
+ #
234
+ # *IMPORTANT*: not all infeasible shipments are returned here, but only the
235
+ # ones that are detected as infeasible as a preprocessing.
236
+ DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
237
+ end
238
+
239
+ # Mode defining the behavior of the search, trading off latency versus
240
+ # solution quality. In all modes, the global request deadline is enforced.
241
+ module SearchMode
242
+ # Unspecified search mode, equivalent to `RETURN_FAST`.
243
+ SEARCH_MODE_UNSPECIFIED = 0
244
+
245
+ # Stop the search after finding the first good solution.
246
+ RETURN_FAST = 1
247
+
248
+ # Spend all the available time to search for better solutions.
249
+ CONSUME_ALL_AVAILABLE_TIME = 2
250
+ end
251
+ end
252
+
253
+ # Response after solving a tour optimization problem containing the routes
254
+ # followed by each vehicle, the shipments which have been skipped and the
255
+ # overall cost of the solution.
256
+ # @!attribute [rw] routes
257
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>]
258
+ # Routes computed for each vehicle; the i-th route corresponds to the i-th
259
+ # vehicle in the model.
260
+ # @!attribute [rw] request_label
261
+ # @return [::String]
262
+ # Copy of the {::Google::Cloud::Optimization::V1::OptimizeToursRequest#label OptimizeToursRequest.label}, if a label was specified in the
263
+ # request.
264
+ # @!attribute [rw] skipped_shipments
265
+ # @return [::Array<::Google::Cloud::Optimization::V1::SkippedShipment>]
266
+ # The list of all shipments skipped.
267
+ # @!attribute [rw] validation_errors
268
+ # @return [::Array<::Google::Cloud::Optimization::V1::OptimizeToursValidationError>]
269
+ # List of all the validation errors that we were able to detect
270
+ # independently. See the "MULTIPLE ERRORS" explanation for the
271
+ # {::Google::Cloud::Optimization::V1::OptimizeToursValidationError OptimizeToursValidationError} message.
272
+ # @!attribute [rw] metrics
273
+ # @return [::Google::Cloud::Optimization::V1::OptimizeToursResponse::Metrics]
274
+ # Duration, distance and usage metrics for this solution.
275
+ # @!attribute [rw] total_cost
276
+ # @return [::Float]
277
+ # Deprecated: Use [Metrics.total_cost][] instead.
278
+ # Total cost of the solution. This takes into account all costs: costs per
279
+ # per hour and travel hour, fixed vehicle costs, unperformed shipment penalty
280
+ # costs, global duration cost, etc.
281
+ class OptimizeToursResponse
282
+ include ::Google::Protobuf::MessageExts
283
+ extend ::Google::Protobuf::MessageExts::ClassMethods
284
+
285
+ # Overall metrics, aggregated over all routes.
286
+ # @!attribute [rw] aggregated_route_metrics
287
+ # @return [::Google::Cloud::Optimization::V1::AggregatedMetrics]
288
+ # Aggregated over the routes. Each metric is the sum (or max, for loads)
289
+ # over all {::Google::Cloud::Optimization::V1::ShipmentRoute#metrics ShipmentRoute.metrics} fields of the same name.
290
+ # @!attribute [rw] skipped_mandatory_shipment_count
291
+ # @return [::Integer]
292
+ # Number of mandatory shipments skipped.
293
+ # @!attribute [rw] used_vehicle_count
294
+ # @return [::Integer]
295
+ # Number of vehicles used. Note: if a vehicle route is empty and
296
+ # {::Google::Cloud::Optimization::V1::Vehicle#used_if_route_is_empty Vehicle.used_if_route_is_empty} is true, the vehicle is considered
297
+ # used.
298
+ # @!attribute [rw] earliest_vehicle_start_time
299
+ # @return [::Google::Protobuf::Timestamp]
300
+ # The earliest start time for a used vehicle, computed as the minimum over
301
+ # all used vehicles of {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_start_time ShipmentRoute.vehicle_start_time}.
302
+ # @!attribute [rw] latest_vehicle_end_time
303
+ # @return [::Google::Protobuf::Timestamp]
304
+ # The latest end time for a used vehicle, computed as the maximum over all
305
+ # used vehicles of {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_end_time ShipmentRoute.vehicle_end_time}.
306
+ # @!attribute [rw] costs
307
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
308
+ # Cost of the solution, broken down by cost-related request fields.
309
+ # The keys are proto paths, relative to the input OptimizeToursRequest,
310
+ # e.g. "model.shipments.pickups.cost", and the values are the total cost
311
+ # generated by the corresponding cost field, aggregated over the whole
312
+ # solution. In other words, costs["model.shipments.pickups.cost"] is the
313
+ # sum of all pickup costs over the solution. All costs defined in the model
314
+ # are reported in detail here with the exception of costs related to
315
+ # TransitionAttributes that are only reported in an aggregated way as of
316
+ # 2022/01.
317
+ # @!attribute [rw] total_cost
318
+ # @return [::Float]
319
+ # Total cost of the solution. The sum of all values in the costs map.
320
+ class Metrics
321
+ include ::Google::Protobuf::MessageExts
322
+ extend ::Google::Protobuf::MessageExts::ClassMethods
323
+
324
+ # @!attribute [rw] key
325
+ # @return [::String]
326
+ # @!attribute [rw] value
327
+ # @return [::Float]
328
+ class CostsEntry
329
+ include ::Google::Protobuf::MessageExts
330
+ extend ::Google::Protobuf::MessageExts::ClassMethods
331
+ end
332
+ end
333
+ end
334
+
335
+ # Request to batch optimize tours as an asynchronous operation.
336
+ # Each input file should contain one `OptimizeToursRequest`, and each output
337
+ # file will contain one `OptimizeToursResponse`. The request contains
338
+ # information to read/write and parse the files. All the input and output files
339
+ # should be under the same project.
340
+ # @!attribute [rw] parent
341
+ # @return [::String]
342
+ # Required. Target project and location to make a call.
343
+ #
344
+ # Format: `projects/{project-id}/locations/{location-id}`.
345
+ #
346
+ # If no location is specified, a region will be chosen automatically.
347
+ # @!attribute [rw] model_configs
348
+ # @return [::Array<::Google::Cloud::Optimization::V1::BatchOptimizeToursRequest::AsyncModelConfig>]
349
+ # Required. Input/Output information each purchase model, such as file paths and data
350
+ # formats.
351
+ class BatchOptimizeToursRequest
352
+ include ::Google::Protobuf::MessageExts
353
+ extend ::Google::Protobuf::MessageExts::ClassMethods
354
+
355
+ # Information for solving one optimization model asynchronously.
356
+ # @!attribute [rw] display_name
357
+ # @return [::String]
358
+ # User defined model name, can be used as alias by users to keep track of
359
+ # models.
360
+ # @!attribute [rw] input_config
361
+ # @return [::Google::Cloud::Optimization::V1::InputConfig]
362
+ # Required. Information about the input model.
363
+ # @!attribute [rw] output_config
364
+ # @return [::Google::Cloud::Optimization::V1::OutputConfig]
365
+ # Required. The desired output location information.
366
+ # @!attribute [rw] enable_checkpoints
367
+ # @return [::Boolean]
368
+ # If this is set, the model will be solved in the checkpoint mode. In this
369
+ # mode, the input model can have a deadline longer than 30 mins without the
370
+ # risk of interruption. The model will be solved in multiple short-running
371
+ # stages. Each stage generates an intermediate checkpoint
372
+ # and stores it in the user's Cloud Storage buckets. The checkpoint
373
+ # mode should be preferred over
374
+ # allow_large_deadline_despite_interruption_risk since it prevents the risk
375
+ # of interruption.
376
+ class AsyncModelConfig
377
+ include ::Google::Protobuf::MessageExts
378
+ extend ::Google::Protobuf::MessageExts::ClassMethods
379
+ end
380
+ end
381
+
382
+ # Response to a `BatchOptimizeToursRequest`. This is returned in
383
+ # the LRO Operation after the operation is complete.
384
+ class BatchOptimizeToursResponse
385
+ include ::Google::Protobuf::MessageExts
386
+ extend ::Google::Protobuf::MessageExts::ClassMethods
387
+ end
388
+
389
+ # A shipment model contains a set of shipments which must be performed by a
390
+ # set of vehicles, while minimizing the overall cost, which is the sum of:
391
+ #
392
+ # * the cost of routing the vehicles (sum of cost per total time, cost per
393
+ # travel time, and fixed cost over all vehicles).
394
+ # * the unperformed shipment penalties.
395
+ # * the cost of the global duration of the shipments
396
+ # @!attribute [rw] shipments
397
+ # @return [::Array<::Google::Cloud::Optimization::V1::Shipment>]
398
+ # Set of shipments which must be performed in the model.
399
+ # @!attribute [rw] vehicles
400
+ # @return [::Array<::Google::Cloud::Optimization::V1::Vehicle>]
401
+ # Set of vehicles which can be used to perform visits.
402
+ # @!attribute [rw] max_active_vehicles
403
+ # @return [::Integer]
404
+ # Constrains the maximum number of active vehicles. A vehicle is active if
405
+ # its route performs at least one shipment. This can be used to limit the
406
+ # number of routes in the case where there are fewer drivers than
407
+ # vehicles and that the fleet of vehicles is heterogeneous. The optimization
408
+ # will then select the best subset of vehicles to use.
409
+ # Must be strictly positive.
410
+ # @!attribute [rw] global_start_time
411
+ # @return [::Google::Protobuf::Timestamp]
412
+ # Global start and end time of the model: no times outside of this range
413
+ # can be considered valid.
414
+ #
415
+ # The model's time span must be less than a year, i.e. the `global_end_time`
416
+ # and the `global_start_time` must be within 31536000 seconds of each other.
417
+ #
418
+ # When using `cost_per_*hour` fields, you might want to set this window to a
419
+ # smaller interval to increase performance (eg. if you model a single day,
420
+ # you should set the global time limits to that day).
421
+ # If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used
422
+ # as default.
423
+ # @!attribute [rw] global_end_time
424
+ # @return [::Google::Protobuf::Timestamp]
425
+ # If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0)
426
+ # is used as default.
427
+ # @!attribute [rw] global_duration_cost_per_hour
428
+ # @return [::Float]
429
+ # The "global duration" of the overall plan is the difference between the
430
+ # earliest effective start time and the latest effective end time of
431
+ # all vehicles. Users can assign a cost per hour to that quantity to try
432
+ # and optimize for earliest job completion, for example. This cost must be in
433
+ # the same unit as {::Google::Cloud::Optimization::V1::Shipment#penalty_cost Shipment.penalty_cost}.
434
+ # @!attribute [rw] duration_distance_matrices
435
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix>]
436
+ # Specifies duration and distance matrices used in the model. If this field
437
+ # is empty, Google Maps or geodesic distances will be used instead, depending
438
+ # on the value of the `use_geodesic_distances` field. If it is not empty,
439
+ # `use_geodesic_distances` cannot be true and neither
440
+ # `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags`
441
+ # can be empty.
442
+ #
443
+ # Usage examples:
444
+ #
445
+ # * There are two locations: locA and locB.
446
+ # * 1 vehicle starting its route at locA and ending it at locA.
447
+ # * 1 pickup visit request at locB.
448
+ #
449
+ # ```
450
+ # model {
451
+ # vehicles { start_tags: "locA" end_tags: "locA" }
452
+ # shipments { pickups { tags: "locB" } }
453
+ # duration_distance_matrix_src_tags: "locA"
454
+ # duration_distance_matrix_src_tags: "locB"
455
+ # duration_distance_matrix_dst_tags: "locA"
456
+ # duration_distance_matrix_dst_tags: "locB"
457
+ # duration_distance_matrices {
458
+ # rows { # from: locA
459
+ # durations { seconds: 0 } meters: 0 # to: locA
460
+ # durations { seconds: 100 } meters: 1000 # to: locB
461
+ # }
462
+ # rows { # from: locB
463
+ # durations { seconds: 102 } meters: 990 # to: locA
464
+ # durations { seconds: 0 } meters: 0 # to: locB
465
+ # }
466
+ # }
467
+ # }
468
+ # ```
469
+ #
470
+ #
471
+ # * There are three locations: locA, locB and locC.
472
+ # * 1 vehicle starting its route at locA and ending it at locB, using
473
+ # matrix "fast".
474
+ # * 1 vehicle starting its route at locB and ending it at locB, using
475
+ # matrix "slow".
476
+ # * 1 vehicle starting its route at locB and ending it at locB, using
477
+ # matrix "fast".
478
+ # * 1 pickup visit request at locC.
479
+ #
480
+ # ```
481
+ # model {
482
+ # vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
483
+ # vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
484
+ # vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
485
+ # shipments { pickups { tags: "locC" } }
486
+ # duration_distance_matrix_src_tags: "locA"
487
+ # duration_distance_matrix_src_tags: "locB"
488
+ # duration_distance_matrix_src_tags: "locC"
489
+ # duration_distance_matrix_dst_tags: "locB"
490
+ # duration_distance_matrix_dst_tags: "locC"
491
+ # duration_distance_matrices {
492
+ # vehicle_start_tag: "fast"
493
+ # rows { # from: locA
494
+ # durations { seconds: 1000 } meters: 2000 # to: locB
495
+ # durations { seconds: 600 } meters: 1000 # to: locC
496
+ # }
497
+ # rows { # from: locB
498
+ # durations { seconds: 0 } meters: 0 # to: locB
499
+ # durations { seconds: 700 } meters: 1200 # to: locC
500
+ # }
501
+ # rows { # from: locC
502
+ # durations { seconds: 702 } meters: 1190 # to: locB
503
+ # durations { seconds: 0 } meters: 0 # to: locC
504
+ # }
505
+ # }
506
+ # duration_distance_matrices {
507
+ # vehicle_start_tag: "slow"
508
+ # rows { # from: locA
509
+ # durations { seconds: 1800 } meters: 2001 # to: locB
510
+ # durations { seconds: 900 } meters: 1002 # to: locC
511
+ # }
512
+ # rows { # from: locB
513
+ # durations { seconds: 0 } meters: 0 # to: locB
514
+ # durations { seconds: 1000 } meters: 1202 # to: locC
515
+ # }
516
+ # rows { # from: locC
517
+ # durations { seconds: 1001 } meters: 1195 # to: locB
518
+ # durations { seconds: 0 } meters: 0 # to: locC
519
+ # }
520
+ # }
521
+ # }
522
+ # ```
523
+ # @!attribute [rw] duration_distance_matrix_src_tags
524
+ # @return [::Array<::String>]
525
+ # Tags defining the sources of the duration and distance matrices;
526
+ # `duration_distance_matrices(i).rows(j)` defines durations and distances
527
+ # from visits with tag `duration_distance_matrix_src_tags(j)` to other visits
528
+ # in matrix i.
529
+ #
530
+ # Tags correspond to
531
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags VisitRequest.tags}
532
+ # or {::Google::Cloud::Optimization::V1::Vehicle#start_tags Vehicle.start_tags}.
533
+ # A given `VisitRequest` or `Vehicle` must match exactly one tag in this
534
+ # field. Note that a `Vehicle`'s source, destination and matrix tags may be
535
+ # the same; similarly a `VisitRequest`'s source and destination tags may be
536
+ # the same. All tags must be different and cannot be empty strings. If this
537
+ # field is not empty, then `duration_distance_matrices` must not be empty.
538
+ # @!attribute [rw] duration_distance_matrix_dst_tags
539
+ # @return [::Array<::String>]
540
+ # Tags defining the destinations of the duration and distance matrices;
541
+ # `duration_distance_matrices(i).rows(j).durations(k)` (resp.
542
+ # `duration_distance_matrices(i).rows(j).meters(k))` defines the duration
543
+ # (resp. the distance) of the travel from visits with tag
544
+ # `duration_distance_matrix_src_tags(j)` to visits with tag
545
+ # `duration_distance_matrix_dst_tags(k)` in matrix i.
546
+ #
547
+ # Tags correspond to
548
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags VisitRequest.tags}
549
+ # or {::Google::Cloud::Optimization::V1::Vehicle#start_tags Vehicle.start_tags}.
550
+ # A given `VisitRequest` or `Vehicle` must match exactly one tag in this
551
+ # field. Note that a `Vehicle`'s source, destination and matrix tags may be
552
+ # the same; similarly a `VisitRequest`'s source and destination tags may be
553
+ # the same. All tags must be different and cannot be empty strings. If this
554
+ # field is not empty, then `duration_distance_matrices` must not be empty.
555
+ # @!attribute [rw] transition_attributes
556
+ # @return [::Array<::Google::Cloud::Optimization::V1::TransitionAttributes>]
557
+ # Transition attributes added to the model.
558
+ # @!attribute [rw] shipment_type_incompatibilities
559
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility>]
560
+ # Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
561
+ # @!attribute [rw] shipment_type_requirements
562
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentTypeRequirement>]
563
+ # Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
564
+ # @!attribute [rw] precedence_rules
565
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::PrecedenceRule>]
566
+ # Set of precedence rules which must be enforced in the model.
567
+ # @!attribute [rw] break_rules
568
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule>]
569
+ # Deprecated: No longer used.
570
+ # Set of break rules used in the model.
571
+ # Each vehicle specifies the `BreakRule` that applies to it via the
572
+ # {::Google::Cloud::Optimization::V1::Vehicle#break_rule_indices Vehicle.break_rule_indices} field (which must be a singleton).
573
+ class ShipmentModel
574
+ include ::Google::Protobuf::MessageExts
575
+ extend ::Google::Protobuf::MessageExts::ClassMethods
576
+
577
+ # Specifies a duration and distance matrix from visit and vehicle start
578
+ # locations to visit and vehicle end locations.
579
+ # @!attribute [rw] rows
580
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::DurationDistanceMatrix::Row>]
581
+ # Specifies the rows of the duration and distance matrix. It must have as
582
+ # many elements as {::Google::Cloud::Optimization::V1::ShipmentModel#duration_distance_matrix_src_tags ShipmentModel.duration_distance_matrix_src_tags}.
583
+ # @!attribute [rw] vehicle_start_tag
584
+ # @return [::String]
585
+ # Tag defining to which vehicles this duration and distance matrix applies.
586
+ # If empty, this applies to all vehicles, and there can only be a single
587
+ # matrix.
588
+ #
589
+ # Each vehicle start must match exactly one matrix, i.e. exactly one of
590
+ # their `start_tags` field must match the `vehicle_start_tag` of a matrix
591
+ # (and of that matrix only).
592
+ #
593
+ # All matrices must have a different `vehicle_start_tag`.
594
+ class DurationDistanceMatrix
595
+ include ::Google::Protobuf::MessageExts
596
+ extend ::Google::Protobuf::MessageExts::ClassMethods
597
+
598
+ # Specifies a row of the duration and distance matrix.
599
+ # @!attribute [rw] durations
600
+ # @return [::Array<::Google::Protobuf::Duration>]
601
+ # Duration values for a given row. It must have as many elements as
602
+ # {::Google::Cloud::Optimization::V1::ShipmentModel#duration_distance_matrix_dst_tags ShipmentModel.duration_distance_matrix_dst_tags}.
603
+ # @!attribute [rw] meters
604
+ # @return [::Array<::Float>]
605
+ # Distance values for a given row. If no costs or constraints refer to
606
+ # distances in the model, this can be left empty; otherwise it must have
607
+ # as many elements as `durations`.
608
+ class Row
609
+ include ::Google::Protobuf::MessageExts
610
+ extend ::Google::Protobuf::MessageExts::ClassMethods
611
+ end
612
+ end
613
+
614
+ # A precedence rule between two events (each event is the pickup or the
615
+ # delivery of a shipment): the "second" event has to start at least
616
+ # `offset_duration` after "first" has started.
617
+ #
618
+ # Several precedences can refer to the same (or related) events, e.g.,
619
+ # "pickup of B happens after delivery of A" and "pickup of C happens after
620
+ # pickup of B".
621
+ #
622
+ # Furthermore, precedences only apply when both shipments are performed and
623
+ # are otherwise ignored.
624
+ # @!attribute [rw] first_index
625
+ # @return [::Integer]
626
+ # Shipment index of the "first" event. This field must be specified.
627
+ # @!attribute [rw] first_is_delivery
628
+ # @return [::Boolean]
629
+ # Indicates if the "first" event is a delivery.
630
+ # @!attribute [rw] second_index
631
+ # @return [::Integer]
632
+ # Shipment index of the "second" event. This field must be specified.
633
+ # @!attribute [rw] second_is_delivery
634
+ # @return [::Boolean]
635
+ # Indicates if the "second" event is a delivery.
636
+ # @!attribute [rw] offset_duration
637
+ # @return [::Google::Protobuf::Duration]
638
+ # The offset between the "first" and "second" event. It can be negative.
639
+ class PrecedenceRule
640
+ include ::Google::Protobuf::MessageExts
641
+ extend ::Google::Protobuf::MessageExts::ClassMethods
642
+ end
643
+
644
+ # Deprecated: Use top level [BreakRule][] instead.
645
+ # Rules to generate time breaks for a vehicle (e.g. lunch
646
+ # breaks). A break is a contiguous period of time during which the vehicle
647
+ # remains idle at its current position and cannot perform any visit. A break
648
+ # may occur:
649
+ #
650
+ # * during the travel between two visits (which includes the time right
651
+ # before or right after a visit, but not in the middle of a visit), in
652
+ # which case it extends the corresponding transit time between the visits,
653
+ # * or before the vehicle start (the vehicle may not start in the middle of
654
+ # a break), in which case it does not affect the vehicle start time.
655
+ # * or after the vehicle end (ditto, with the vehicle end time).
656
+ # @!attribute [rw] break_requests
657
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule::BreakRequest>]
658
+ # Sequence of breaks. See the `BreakRequest` message.
659
+ # @!attribute [rw] frequency_constraints
660
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentModel::BreakRule::FrequencyConstraint>]
661
+ # Several `FrequencyConstraint` may apply. They must all be satisfied by
662
+ # the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
663
+ class BreakRule
664
+ include ::Google::Protobuf::MessageExts
665
+ extend ::Google::Protobuf::MessageExts::ClassMethods
666
+
667
+ # The sequence of breaks (i.e. their number and order) that apply to each
668
+ # vehicle must be known beforehand. The repeated `BreakRequest`s define
669
+ # that sequence, in the order in which they must occur. Their time windows
670
+ # (`earliest_start_time` / `latest_start_time`) may overlap, but they must
671
+ # be compatible with the order (this is checked).
672
+ # @!attribute [rw] earliest_start_time
673
+ # @return [::Google::Protobuf::Timestamp]
674
+ # Required. Lower bound (inclusive) on the start of the break.
675
+ # @!attribute [rw] latest_start_time
676
+ # @return [::Google::Protobuf::Timestamp]
677
+ # Required. Upper bound (inclusive) on the start of the break.
678
+ # @!attribute [rw] min_duration
679
+ # @return [::Google::Protobuf::Duration]
680
+ # Required. Minimum duration of the break. Must be positive.
681
+ class BreakRequest
682
+ include ::Google::Protobuf::MessageExts
683
+ extend ::Google::Protobuf::MessageExts::ClassMethods
684
+ end
685
+
686
+ # One may further constrain the frequency and duration of the breaks
687
+ # specified above, by enforcing a minimum break frequency, such as
688
+ # "There must be a break of at least 1 hour every 12 hours". Assuming that
689
+ # this can be interpreted as "Within any sliding time window of 12h, there
690
+ # must be at least one break of at least one hour", that example would
691
+ # translate to the following `FrequencyConstraint`:
692
+ # ```
693
+ # {
694
+ # min_break_duration { seconds: 3600 } # 1 hour.
695
+ # max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).
696
+ # }
697
+ # ```
698
+ #
699
+ # The timing and duration of the breaks in the solution will respect all
700
+ # such constraints, in addition to the time windows and minimum durations
701
+ # already specified in the `BreakRequest`.
702
+ #
703
+ # A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
704
+ # For example, the following schedule honors the "1h every 12h" example:
705
+ # ```
706
+ # 04:00 vehicle start
707
+ # .. performing travel and visits ..
708
+ # 09:00 1 hour break
709
+ # 10:00 end of the break
710
+ # .. performing travel and visits ..
711
+ # 12:00 20-min lunch break
712
+ # 12:20 end of the break
713
+ # .. performing travel and visits ..
714
+ # 21:00 1 hour break
715
+ # 22:00 end of the break
716
+ # .. performing travel and visits ..
717
+ # 23:59 vehicle end
718
+ # ```
719
+ # @!attribute [rw] min_break_duration
720
+ # @return [::Google::Protobuf::Duration]
721
+ # Required. Minimum break duration for this constraint. Nonnegative.
722
+ # See description of `FrequencyConstraint`.
723
+ # @!attribute [rw] max_inter_break_duration
724
+ # @return [::Google::Protobuf::Duration]
725
+ # Required. Maximum allowed span of any interval of time in the route that does not
726
+ # include at least partially a break of `duration >=
727
+ # min_break_duration`. Must be positive.
728
+ class FrequencyConstraint
729
+ include ::Google::Protobuf::MessageExts
730
+ extend ::Google::Protobuf::MessageExts::ClassMethods
731
+ end
732
+ end
733
+ end
734
+
735
+ # The shipment of a single item, from one of its pickups to one of its
736
+ # deliveries. For the shipment to be considered as performed, a unique vehicle
737
+ # must visit one of its pickup locations (and decrease its spare capacities
738
+ # accordingly), then visit one of its delivery locations later on (and
739
+ # therefore re-increase its spare capacities accordingly).
740
+ # @!attribute [rw] pickups
741
+ # @return [::Array<::Google::Cloud::Optimization::V1::Shipment::VisitRequest>]
742
+ # Set of pickup alternatives associated to the shipment. If not specified,
743
+ # the vehicle only needs to visit a location corresponding to the deliveries.
744
+ # @!attribute [rw] deliveries
745
+ # @return [::Array<::Google::Cloud::Optimization::V1::Shipment::VisitRequest>]
746
+ # Set of delivery alternatives associated to the shipment. If not specified,
747
+ # the vehicle only needs to visit a location corresponding to the pickups.
748
+ # @!attribute [rw] load_demands
749
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
750
+ # Load demands of the shipment (for example weight, volume, number of
751
+ # pallets etc). The keys in the map should be identifiers describing the type
752
+ # of the corresponding load, ideally also including the units.
753
+ # For example: "weight_kg", "volume_gallons", "pallet_count", etc.
754
+ # If a given key does not appear in the map, the corresponding load is
755
+ # considered as null.
756
+ # @!attribute [rw] penalty_cost
757
+ # @return [::Float]
758
+ # If the shipment is not completed, this penalty is added to the overall
759
+ # cost of the routes. A shipment is considered completed if one of its pickup
760
+ # and delivery alternatives is visited. The cost may be expressed in the
761
+ # same unit used for all other cost-related fields in the model and must be
762
+ # positive.
763
+ #
764
+ # *IMPORTANT*: If this penalty is not specified, it is considered infinite,
765
+ # i.e. the shipment must be completed.
766
+ # @!attribute [rw] allowed_vehicle_indices
767
+ # @return [::Array<::Integer>]
768
+ # The set of vehicles that may perform this shipment. If empty, all vehicles
769
+ # may perform it. Vehicles are given by their index in the `ShipmentModel`'s
770
+ # `vehicles` list.
771
+ # @!attribute [rw] costs_per_vehicle
772
+ # @return [::Array<::Float>]
773
+ # Specifies the cost that is incurred when this shipment is delivered by each
774
+ # vehicle. If specified, it must have EITHER:
775
+ #
776
+ # * the same number of elements as `costs_per_vehicle_indices`.
777
+ # `costs_per_vehicle[i]` corresponds to vehicle
778
+ # `costs_per_vehicle_indices[i]` of the model.
779
+ # * the same number of elements as there are vehicles in the model. The
780
+ # i-th element corresponds to vehicle #i of the model.
781
+ #
782
+ # These costs must be in the same unit as `penalty_cost` and must not be
783
+ # negative. Leave this field empty, if there are no such costs.
784
+ # @!attribute [rw] costs_per_vehicle_indices
785
+ # @return [::Array<::Integer>]
786
+ # Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty,
787
+ # it must have the same number of elements as `costs_per_vehicle`. A vehicle
788
+ # index may not be specified more than once. If a vehicle is excluded from
789
+ # `costs_per_vehicle_indices`, its cost is zero.
790
+ # @!attribute [rw] pickup_to_delivery_relative_detour_limit
791
+ # @return [::Float]
792
+ # Specifies the maximum relative detour time compared to the shortest path
793
+ # from pickup to delivery. If specified, it must be nonnegative, and the
794
+ # shipment must contain at least a pickup and a delivery.
795
+ #
796
+ # For example, let t be the shortest time taken to go from the selected
797
+ # pickup alternative directly to the selected delivery alternative. Then
798
+ # setting `pickup_to_delivery_relative_detour_limit` enforces:
799
+ #
800
+ # ```
801
+ # start_time(delivery) - start_time(pickup) <=
802
+ # std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))
803
+ # ```
804
+ #
805
+ # If both relative and absolute limits are specified on the same shipment,
806
+ # the more constraining limit is used for each possible pickup/delivery pair.
807
+ # As of 2017/10, detours are only supported when travel durations do not
808
+ # depend on vehicles.
809
+ # @!attribute [rw] pickup_to_delivery_absolute_detour_limit
810
+ # @return [::Google::Protobuf::Duration]
811
+ # Specifies the maximum absolute detour time compared to the shortest path
812
+ # from pickup to delivery. If specified, it must be nonnegative, and the
813
+ # shipment must contain at least a pickup and a delivery.
814
+ #
815
+ # For example, let t be the shortest time taken to go from the selected
816
+ # pickup alternative directly to the selected delivery alternative. Then
817
+ # setting `pickup_to_delivery_absolute_detour_limit` enforces:
818
+ #
819
+ # ```
820
+ # start_time(delivery) - start_time(pickup) <=
821
+ # t + pickup_to_delivery_absolute_detour_limit
822
+ # ```
823
+ #
824
+ # If both relative and absolute limits are specified on the same shipment,
825
+ # the more constraining limit is used for each possible pickup/delivery pair.
826
+ # As of 2017/10, detours are only supported when travel durations do not
827
+ # depend on vehicles.
828
+ # @!attribute [rw] pickup_to_delivery_time_limit
829
+ # @return [::Google::Protobuf::Duration]
830
+ # Specifies the maximum duration from start of pickup to start of delivery of
831
+ # a shipment. If specified, it must be nonnegative, and the shipment must
832
+ # contain at least a pickup and a delivery. This does not depend on which
833
+ # alternatives are selected for pickup and delivery, nor on vehicle speed.
834
+ # This can be specified alongside maximum detour constraints: the solution
835
+ # will respect both specifications.
836
+ # @!attribute [rw] shipment_type
837
+ # @return [::String]
838
+ # Non-empty string specifying a "type" for this shipment.
839
+ # This feature can be used to define incompatibilities or requirements
840
+ # between `shipment_types` (see `shipment_type_incompatibilities` and
841
+ # `shipment_type_requirements` in `ShipmentModel`).
842
+ #
843
+ # Differs from `visit_types` which is specified for a single visit: All
844
+ # pickup/deliveries belonging to the same shipment share the same
845
+ # `shipment_type`.
846
+ # @!attribute [rw] label
847
+ # @return [::String]
848
+ # Specifies a label for this shipment. This label is reported in the response
849
+ # in the `shipment_label` of the corresponding {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit ShipmentRoute.Visit}.
850
+ # @!attribute [rw] ignore
851
+ # @return [::Boolean]
852
+ # If true, skip this shipment, but don't apply a `penalty_cost`.
853
+ #
854
+ # Ignoring a shipment results in a validation error when there are any
855
+ # `shipment_type_requirements` in the model.
856
+ #
857
+ # Ignoring a shipment that is performed in `injected_first_solution_routes`
858
+ # or `injected_solution_constraint` is permitted; the solver removes the
859
+ # related pickup/delivery visits from the performing route.
860
+ # `precedence_rules` that reference ignored shipments will also be ignored.
861
+ # @!attribute [rw] demands
862
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
863
+ # Deprecated: Use [Shipment.load_demands][] instead.
864
+ class Shipment
865
+ include ::Google::Protobuf::MessageExts
866
+ extend ::Google::Protobuf::MessageExts::ClassMethods
867
+
868
+ # Request for a visit which can be done by a vehicle: it has a geo-location
869
+ # (or two, see below), opening and closing times represented by time windows,
870
+ # and a service duration time (time spent by the vehicle once it has arrived
871
+ # to pickup or drop off goods).
872
+ # @!attribute [rw] arrival_location
873
+ # @return [::Google::Type::LatLng]
874
+ # The geo-location where the vehicle arrives when performing this
875
+ # `VisitRequest`. If the shipment model has duration distance matrices,
876
+ # `arrival_location` must not be specified.
877
+ # @!attribute [rw] arrival_waypoint
878
+ # @return [::Google::Cloud::Optimization::V1::Waypoint]
879
+ # The waypoint where the vehicle arrives when performing this
880
+ # `VisitRequest`. If the shipment model has duration distance matrices,
881
+ # `arrival_waypoint` must not be specified.
882
+ # @!attribute [rw] departure_location
883
+ # @return [::Google::Type::LatLng]
884
+ # The geo-location where the vehicle departs after completing this
885
+ # `VisitRequest`. Can be omitted if it is the same as `arrival_location`.
886
+ # If the shipment model has duration distance matrices,
887
+ # `departure_location` must not be specified.
888
+ # @!attribute [rw] departure_waypoint
889
+ # @return [::Google::Cloud::Optimization::V1::Waypoint]
890
+ # The waypoint where the vehicle departs after completing this
891
+ # `VisitRequest`. Can be omitted if it is the same as `arrival_waypoint`.
892
+ # If the shipment model has duration distance matrices,
893
+ # `departure_waypoint` must not be specified.
894
+ # @!attribute [rw] tags
895
+ # @return [::Array<::String>]
896
+ # Specifies tags attached to the visit request.
897
+ # Empty or duplicate strings are not allowed.
898
+ # @!attribute [rw] time_windows
899
+ # @return [::Array<::Google::Cloud::Optimization::V1::TimeWindow>]
900
+ # Time windows which constrain the arrival time at a visit.
901
+ # Note that a vehicle may depart outside of the arrival time window, i.e.
902
+ # arrival time + duration do not need to be inside a time window. This can
903
+ # result in waiting time if the vehicle arrives before
904
+ # {::Google::Cloud::Optimization::V1::TimeWindow#start_time TimeWindow.start_time}.
905
+ #
906
+ # The absence of `TimeWindow` means that the vehicle can perform this visit
907
+ # at any time.
908
+ #
909
+ # Time windows must be disjoint, i.e. no time window must overlap with or
910
+ # be adjacent to another, and they must be in increasing order.
911
+ #
912
+ # `cost_per_hour_after_soft_end_time` and `soft_end_time` can only
913
+ # be set if there is a single time window.
914
+ # @!attribute [rw] duration
915
+ # @return [::Google::Protobuf::Duration]
916
+ # Duration of the visit, i.e. time spent by the vehicle between arrival
917
+ # and departure (to be added to the possible waiting time; see
918
+ # `time_windows`).
919
+ # @!attribute [rw] cost
920
+ # @return [::Float]
921
+ # Cost to service this visit request on a vehicle route. This can be used
922
+ # to pay different costs for each alternative pickup or delivery of a
923
+ # shipment. This cost must be in the same unit as `Shipment.penalty_cost`
924
+ # and must not be negative.
925
+ # @!attribute [rw] load_demands
926
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
927
+ # Load demands of this visit request. This is just like
928
+ # {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands} field, except that it only applies to this
929
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest VisitRequest} instead of the whole {::Google::Cloud::Optimization::V1::Shipment Shipment}.
930
+ # The demands listed here are added to the demands listed in
931
+ # {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}.
932
+ # @!attribute [rw] visit_types
933
+ # @return [::Array<::String>]
934
+ # Specifies the types of the visit. This may be used to allocate additional
935
+ # time required for a vehicle to complete this visit (see
936
+ # {::Google::Cloud::Optimization::V1::Vehicle#extra_visit_duration_for_visit_type Vehicle.extra_visit_duration_for_visit_type}).
937
+ #
938
+ # A type can only appear once.
939
+ # @!attribute [rw] label
940
+ # @return [::String]
941
+ # Specifies a label for this `VisitRequest`. This label is reported in the
942
+ # response as `visit_label` in the corresponding {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit ShipmentRoute.Visit}.
943
+ # @!attribute [rw] demands
944
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
945
+ # Deprecated: Use [VisitRequest.load_demands][] instead.
946
+ class VisitRequest
947
+ include ::Google::Protobuf::MessageExts
948
+ extend ::Google::Protobuf::MessageExts::ClassMethods
949
+
950
+ # @!attribute [rw] key
951
+ # @return [::String]
952
+ # @!attribute [rw] value
953
+ # @return [::Google::Cloud::Optimization::V1::Shipment::Load]
954
+ class LoadDemandsEntry
955
+ include ::Google::Protobuf::MessageExts
956
+ extend ::Google::Protobuf::MessageExts::ClassMethods
957
+ end
958
+ end
959
+
960
+ # When performing a visit, a predefined amount may be added to the vehicle
961
+ # load if it's a pickup, or subtracted if it's a delivery. This message
962
+ # defines such amount. See {::Google::Cloud::Optimization::V1::Shipment#load_demands load_demands}.
963
+ # @!attribute [rw] amount
964
+ # @return [::Integer]
965
+ # The amount by which the load of the vehicle performing the corresponding
966
+ # visit will vary. Since it is an integer, users are advised to choose an
967
+ # appropriate unit to avoid loss of precision. Must be ≥ 0.
968
+ class Load
969
+ include ::Google::Protobuf::MessageExts
970
+ extend ::Google::Protobuf::MessageExts::ClassMethods
971
+ end
972
+
973
+ # @!attribute [rw] key
974
+ # @return [::String]
975
+ # @!attribute [rw] value
976
+ # @return [::Google::Cloud::Optimization::V1::Shipment::Load]
977
+ class LoadDemandsEntry
978
+ include ::Google::Protobuf::MessageExts
979
+ extend ::Google::Protobuf::MessageExts::ClassMethods
980
+ end
981
+ end
982
+
983
+ # Specifies incompatibilties between shipments depending on their
984
+ # shipment_type. The appearance of incompatible shipments on the same route is
985
+ # restricted based on the incompatibility mode.
986
+ # @!attribute [rw] types
987
+ # @return [::Array<::String>]
988
+ # List of incompatible types. Two shipments having different `shipment_types`
989
+ # among those listed are "incompatible".
990
+ # @!attribute [rw] incompatibility_mode
991
+ # @return [::Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility::IncompatibilityMode]
992
+ # Mode applied to the incompatibility.
993
+ class ShipmentTypeIncompatibility
994
+ include ::Google::Protobuf::MessageExts
995
+ extend ::Google::Protobuf::MessageExts::ClassMethods
996
+
997
+ # Modes defining how the appearance of incompatible shipments are restricted
998
+ # on the same route.
999
+ module IncompatibilityMode
1000
+ # Unspecified incompatibility mode. This value should never be used.
1001
+ INCOMPATIBILITY_MODE_UNSPECIFIED = 0
1002
+
1003
+ # In this mode, two shipments with incompatible types can never share the
1004
+ # same vehicle.
1005
+ NOT_PERFORMED_BY_SAME_VEHICLE = 1
1006
+
1007
+ # For two shipments with incompatible types with the
1008
+ # `NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY` incompatibility mode:
1009
+ #
1010
+ # * If both are pickups only (no deliveries) or deliveries only (no
1011
+ # pickups), they cannot share the same vehicle at all.
1012
+ # * If one of the shipments has a delivery and the other a pickup, the two
1013
+ # shipments can share the same vehicle iff the former shipment is
1014
+ # delivered before the latter is picked up.
1015
+ NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY = 2
1016
+ end
1017
+ end
1018
+
1019
+ # Specifies requirements between shipments based on their shipment_type.
1020
+ # The specifics of the requirement are defined by the requirement mode.
1021
+ # @!attribute [rw] required_shipment_type_alternatives
1022
+ # @return [::Array<::String>]
1023
+ # List of alternative shipment types required by the
1024
+ # `dependent_shipment_types`.
1025
+ # @!attribute [rw] dependent_shipment_types
1026
+ # @return [::Array<::String>]
1027
+ # All shipments with a type in the `dependent_shipment_types` field require
1028
+ # at least one shipment of type `required_shipment_type_alternatives` to be
1029
+ # visited on the same route.
1030
+ #
1031
+ # NOTE: Chains of requirements such that a `shipment_type` depends on itself
1032
+ # are not allowed.
1033
+ # @!attribute [rw] requirement_mode
1034
+ # @return [::Google::Cloud::Optimization::V1::ShipmentTypeRequirement::RequirementMode]
1035
+ # Mode applied to the requirement.
1036
+ class ShipmentTypeRequirement
1037
+ include ::Google::Protobuf::MessageExts
1038
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1039
+
1040
+ # Modes defining the appearance of dependent shipments on a route.
1041
+ module RequirementMode
1042
+ # Unspecified requirement mode. This value should never be used.
1043
+ REQUIREMENT_MODE_UNSPECIFIED = 0
1044
+
1045
+ # In this mode, all "dependent" shipments must share the same vehicle as at
1046
+ # least one of their "required" shipments.
1047
+ PERFORMED_BY_SAME_VEHICLE = 1
1048
+
1049
+ # With the `IN_SAME_VEHICLE_AT_PICKUP_TIME` mode, all "dependent"
1050
+ # shipments need to have at least one "required" shipment on their vehicle
1051
+ # at the time of their pickup.
1052
+ #
1053
+ # A "dependent" shipment pickup must therefore have either:
1054
+ #
1055
+ # * A delivery-only "required" shipment delivered on the route after, or
1056
+ # * A "required" shipment picked up on the route before it, and if the
1057
+ # "required" shipment has a delivery, this delivery must be performed
1058
+ # after the "dependent" shipment's pickup.
1059
+ IN_SAME_VEHICLE_AT_PICKUP_TIME = 2
1060
+
1061
+ # Same as before, except the "dependent" shipments need to have a
1062
+ # "required" shipment on their vehicle at the time of their *delivery*.
1063
+ IN_SAME_VEHICLE_AT_DELIVERY_TIME = 3
1064
+ end
1065
+ end
1066
+
1067
+ # Models a vehicle in a shipment problem. Solving a shipment problem will
1068
+ # build a route starting from `start_location` and ending at `end_location`
1069
+ # for this vehicle. A route is a sequence of visits (see `ShipmentRoute`).
1070
+ # @!attribute [rw] travel_mode
1071
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::TravelMode]
1072
+ # The travel mode which affects the roads usable by the vehicle and its
1073
+ # speed. See also `travel_duration_multiple`.
1074
+ # @!attribute [rw] start_location
1075
+ # @return [::Google::Type::LatLng]
1076
+ # Geographic location where the vehicle starts before picking up any
1077
+ # shipments. If not specified, the vehicle starts at its first pickup.
1078
+ # If the shipment model has duration and distance matrices, `start_location`
1079
+ # must not be specified.
1080
+ # @!attribute [rw] start_waypoint
1081
+ # @return [::Google::Cloud::Optimization::V1::Waypoint]
1082
+ # Waypoint representing a geographic location where the vehicle starts before
1083
+ # picking up any shipments. If neither `start_waypoint` nor `start_location`
1084
+ # is specified, the vehicle starts at its first pickup.
1085
+ # If the shipment model has duration and distance matrices, `start_waypoint`
1086
+ # must not be specified.
1087
+ # @!attribute [rw] end_location
1088
+ # @return [::Google::Type::LatLng]
1089
+ # Geographic location where the vehicle ends after it has completed its last
1090
+ # `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends
1091
+ # immediately when it completes its last `VisitRequest`.
1092
+ # If the shipment model has duration and distance matrices, `end_location`
1093
+ # must not be specified.
1094
+ # @!attribute [rw] end_waypoint
1095
+ # @return [::Google::Cloud::Optimization::V1::Waypoint]
1096
+ # Waypoint representing a geographic location where the vehicle ends after
1097
+ # it has completed its last `VisitRequest`. If neither `end_waypoint` nor
1098
+ # `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately
1099
+ # when it completes its last `VisitRequest`.
1100
+ # If the shipment model has duration and distance matrices, `end_waypoint`
1101
+ # must not be specified.
1102
+ # @!attribute [rw] start_tags
1103
+ # @return [::Array<::String>]
1104
+ # Specifies tags attached to the start of the vehicle's route.
1105
+ #
1106
+ # Empty or duplicate strings are not allowed.
1107
+ # @!attribute [rw] end_tags
1108
+ # @return [::Array<::String>]
1109
+ # Specifies tags attached to the end of the vehicle's route.
1110
+ #
1111
+ # Empty or duplicate strings are not allowed.
1112
+ # @!attribute [rw] start_time_windows
1113
+ # @return [::Array<::Google::Cloud::Optimization::V1::TimeWindow>]
1114
+ # Time windows during which the vehicle may depart its start location.
1115
+ # They must be within the global time limits (see
1116
+ # [ShipmentModel.global_*][google.cloud.optimization.v1.ShipmentModel.global_start_time]
1117
+ # fields). If unspecified, there is no limitation besides those global time
1118
+ # limits.
1119
+ #
1120
+ # Time windows belonging to the same repeated field must be disjoint, i.e. no
1121
+ # time window can overlap with or be adjacent to another, and they must be in
1122
+ # chronological order.
1123
+ #
1124
+ # `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
1125
+ # there is a single time window.
1126
+ # @!attribute [rw] end_time_windows
1127
+ # @return [::Array<::Google::Cloud::Optimization::V1::TimeWindow>]
1128
+ # Time windows during which the vehicle may arrive at its end location.
1129
+ # They must be within the global time limits (see
1130
+ # [ShipmentModel.global_*][google.cloud.optimization.v1.ShipmentModel.global_start_time]
1131
+ # fields). If unspecified, there is no limitation besides those global time
1132
+ # limits.
1133
+ #
1134
+ # Time windows belonging to the same repeated field must be disjoint, i.e. no
1135
+ # time window can overlap with or be adjacent to another, and they must be in
1136
+ # chronological order.
1137
+ #
1138
+ # `cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if
1139
+ # there is a single time window.
1140
+ # @!attribute [rw] travel_duration_multiple
1141
+ # @return [::Float]
1142
+ # Specifies a multiplicative factor that can be used to increase or decrease
1143
+ # travel times of this vehicle. For example, setting this to 2.0 means
1144
+ # that this vehicle is slower and has travel times that are twice what they
1145
+ # are for standard vehicles. This multiple does not affect visit durations.
1146
+ # It does affect cost if `cost_per_hour` or `cost_per_traveled_hour` are
1147
+ # specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle
1148
+ # is standard, and this multiple is considered 1.0.
1149
+ #
1150
+ # WARNING: Travel times will be rounded to the nearest second after this
1151
+ # multiple is applied but before performing any numerical operations, thus,
1152
+ # a small multiple may result in a loss of precision.
1153
+ #
1154
+ # See also `extra_visit_duration_for_visit_type` below.
1155
+ # @!attribute [rw] unloading_policy
1156
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::UnloadingPolicy]
1157
+ # Unloading policy enforced on the vehicle.
1158
+ # @!attribute [rw] load_limits
1159
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit}]
1160
+ # Capacities of the vehicle (weight, volume, # of pallets for example).
1161
+ # The keys in the map are the identifiers of the type of load, consistent
1162
+ # with the keys of the
1163
+ # {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
1164
+ # field. If a given key is absent from this map, the corresponding capacity
1165
+ # is considered to be limitless.
1166
+ # @!attribute [rw] cost_per_hour
1167
+ # @return [::Float]
1168
+ # Vehicle costs: all costs add up and must be in the same unit as
1169
+ # {::Google::Cloud::Optimization::V1::Shipment#penalty_cost Shipment.penalty_cost}.
1170
+ #
1171
+ # Cost per hour of the vehicle route. This cost is applied to the total time
1172
+ # taken by the route, and includes travel time, waiting time, and visit time.
1173
+ # Using `cost_per_hour` instead of just `cost_per_traveled_hour` may result
1174
+ # in additional latency.
1175
+ # @!attribute [rw] cost_per_traveled_hour
1176
+ # @return [::Float]
1177
+ # Cost per traveled hour of the vehicle route. This cost is applied only to
1178
+ # travel time taken by the route (i.e., that reported in
1179
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#transitions ShipmentRoute.transitions}), and excludes waiting time and visit time.
1180
+ # @!attribute [rw] cost_per_kilometer
1181
+ # @return [::Float]
1182
+ # Cost per kilometer of the vehicle route. This cost is applied to the
1183
+ # distance reported in the {::Google::Cloud::Optimization::V1::ShipmentRoute#transitions ShipmentRoute.transitions} and does not apply
1184
+ # to any distance implicitly traveled from the `arrival_location` to the
1185
+ # `departure_location` of a single `VisitRequest`.
1186
+ # @!attribute [rw] fixed_cost
1187
+ # @return [::Float]
1188
+ # Fixed cost applied if this vehicle is used to handle a shipment.
1189
+ # @!attribute [rw] used_if_route_is_empty
1190
+ # @return [::Boolean]
1191
+ # This field only applies to vehicles when their route does not serve any
1192
+ # shipments. It indicates if the vehicle should be considered as used or not
1193
+ # in this case.
1194
+ #
1195
+ # If true, the vehicle goes from its start to its end location even if it
1196
+ # doesn't serve any shipments, and time and distance costs resulting from its
1197
+ # start --> end travel are taken into account.
1198
+ #
1199
+ # Otherwise, it doesn't travel from its start to its end location, and no
1200
+ # `break_rule` or delay (from `TransitionAttributes`) are scheduled for this
1201
+ # vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any
1202
+ # information except for the vehicle index and label.
1203
+ # @!attribute [rw] route_duration_limit
1204
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::DurationLimit]
1205
+ # Limit applied to the total duration of the vehicle's route. In a given
1206
+ # `OptimizeToursResponse`, the route duration of a vehicle is the
1207
+ # difference between its `vehicle_end_time` and `vehicle_start_time`.
1208
+ # @!attribute [rw] travel_duration_limit
1209
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::DurationLimit]
1210
+ # Limit applied to the travel duration of the vehicle's route. In a given
1211
+ # `OptimizeToursResponse`, the route travel duration is the sum of all its
1212
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#travel_duration transitions.travel_duration}.
1213
+ # @!attribute [rw] route_distance_limit
1214
+ # @return [::Google::Cloud::Optimization::V1::DistanceLimit]
1215
+ # Limit applied to the total distance of the vehicle's route. In a given
1216
+ # `OptimizeToursResponse`, the route distance is the sum of all its
1217
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#travel_distance_meters transitions.travel_distance_meters}.
1218
+ # @!attribute [rw] extra_visit_duration_for_visit_type
1219
+ # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Duration}]
1220
+ # Specifies a map from visit_types strings to durations. The duration is time
1221
+ # in addition to
1222
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#duration VisitRequest.duration}
1223
+ # to be taken at visits with the specified `visit_types`. This extra visit
1224
+ # duration adds cost if `cost_per_hour` is specified. Keys (i.e.
1225
+ # `visit_types`) cannot be empty strings.
1226
+ #
1227
+ # If a visit request has multiple types, a duration will be added for each
1228
+ # type in the map.
1229
+ # @!attribute [rw] break_rule
1230
+ # @return [::Google::Cloud::Optimization::V1::BreakRule]
1231
+ # Describes the break schedule to be enforced on this vehicle.
1232
+ # If empty, no breaks will be scheduled for this vehicle.
1233
+ # @!attribute [rw] label
1234
+ # @return [::String]
1235
+ # Specifies a label for this vehicle. This label is reported in the response
1236
+ # as the `vehicle_label` of the corresponding {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
1237
+ # @!attribute [rw] ignore
1238
+ # @return [::Boolean]
1239
+ # If true, `used_if_route_is_empty` must be false, and this vehicle will
1240
+ # remain unused.
1241
+ #
1242
+ # If a shipment is performed by an ignored vehicle in
1243
+ # `injected_first_solution_routes`, it is skipped in the first solution but
1244
+ # is free to be performed in the response.
1245
+ #
1246
+ # If a shipment is performed by an ignored vehicle in
1247
+ # `injected_solution_constraint` and any related pickup/delivery is
1248
+ # constrained to remain on the vehicle (i.e., not relaxed to level
1249
+ # `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response.
1250
+ # If a shipment has a non-empty `allowed_vehicle_indices` field and all of
1251
+ # the allowed vehicles are ignored, it is skipped in the response.
1252
+ # @!attribute [rw] break_rule_indices
1253
+ # @return [::Array<::Integer>]
1254
+ # Deprecated: No longer used.
1255
+ # Indices in the `break_rule` field in the source
1256
+ # [ShipmentModel][]. They correspond to break rules enforced on the vehicle.
1257
+ #
1258
+ #
1259
+ # As of 2018/03, at most one rule index per vehicle can be specified.
1260
+ # @!attribute [rw] capacities
1261
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
1262
+ # Deprecated: Use [Vehicle.load_limits][] instead.
1263
+ # @!attribute [rw] start_load_intervals
1264
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantityInterval>]
1265
+ # Deprecated: Use [Vehicle.LoadLimit.start_load_interval][] instead.
1266
+ # @!attribute [rw] end_load_intervals
1267
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantityInterval>]
1268
+ # Deprecated: Use [Vehicle.LoadLimit.end_load_interval][] instead.
1269
+ class Vehicle
1270
+ include ::Google::Protobuf::MessageExts
1271
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1272
+
1273
+ # Defines a load limit applying to a vehicle, e.g. "this truck may only
1274
+ # carry up to 3500 kg". See {::Google::Cloud::Optimization::V1::Vehicle#load_limits load_limits}.
1275
+ # @!attribute [rw] max_load
1276
+ # @return [::Integer]
1277
+ # The maximum acceptable amount of load.
1278
+ # @!attribute [rw] soft_max_load
1279
+ # @return [::Integer]
1280
+ # A soft limit of the load. See {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max cost_per_unit_above_soft_max}.
1281
+ # @!attribute [rw] cost_per_unit_above_soft_max
1282
+ # @return [::Float]
1283
+ # If the load ever exceeds {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load soft_max_load} along this vehicle's route,
1284
+ # the following cost penalty applies (only once per vehicle):
1285
+ # (load - {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load soft_max_load}) * {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max cost_per_unit_above_soft_max}. All costs
1286
+ # add up and must be in the same unit as {::Google::Cloud::Optimization::V1::Shipment#penalty_cost Shipment.penalty_cost}.
1287
+ # @!attribute [rw] start_load_interval
1288
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval]
1289
+ # The acceptable load interval of the vehicle at the start of the route.
1290
+ # @!attribute [rw] end_load_interval
1291
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval]
1292
+ # The acceptable load interval of the vehicle at the end of the route.
1293
+ class LoadLimit
1294
+ include ::Google::Protobuf::MessageExts
1295
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1296
+
1297
+ # Interval of acceptable load amounts.
1298
+ # @!attribute [rw] min
1299
+ # @return [::Integer]
1300
+ # A minimum acceptable load. Must be ≥ 0.
1301
+ # If they're both specified, {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval#min min} must be ≤ {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval#max max}.
1302
+ # @!attribute [rw] max
1303
+ # @return [::Integer]
1304
+ # A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum
1305
+ # load is unrestricted by this message.
1306
+ # If they're both specified, {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval#min min} must be ≤ {::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval#max max}.
1307
+ class Interval
1308
+ include ::Google::Protobuf::MessageExts
1309
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1310
+ end
1311
+ end
1312
+
1313
+ # A limit defining a maximum duration of the route of a vehicle. It can be
1314
+ # either hard or soft.
1315
+ #
1316
+ # When a soft limit field is defined, both the soft max threshold and its
1317
+ # associated cost must be defined together.
1318
+ # @!attribute [rw] max_duration
1319
+ # @return [::Google::Protobuf::Duration]
1320
+ # A hard limit constraining the duration to be at most max_duration.
1321
+ # @!attribute [rw] soft_max_duration
1322
+ # @return [::Google::Protobuf::Duration]
1323
+ # A soft limit not enforcing a maximum duration limit, but when violated
1324
+ # makes the route incur a cost. This cost adds up to other costs defined in
1325
+ # the model, with the same unit.
1326
+ #
1327
+ # If defined, `soft_max_duration` must be nonnegative. If max_duration is
1328
+ # also defined, `soft_max_duration` must be less than max_duration.
1329
+ # @!attribute [rw] cost_per_hour_after_soft_max
1330
+ # @return [::Float]
1331
+ # Cost per hour incurred if the `soft_max_duration` threshold is violated.
1332
+ # The additional cost is 0 if the duration is under the threshold,
1333
+ # otherwise the cost depends on the duration as follows:
1334
+ # ```
1335
+ # cost_per_hour_after_soft_max * (duration - soft_max_duration)
1336
+ # ```
1337
+ # The cost must be nonnegative.
1338
+ # @!attribute [rw] quadratic_soft_max_duration
1339
+ # @return [::Google::Protobuf::Duration]
1340
+ # A soft limit not enforcing a maximum duration limit, but when violated
1341
+ # makes the route incur a cost, quadratic in the duration. This cost adds
1342
+ # up to other costs defined in the model, with the same unit.
1343
+ #
1344
+ # If defined, `quadratic_soft_max_duration` must be nonnegative. If
1345
+ # `max_duration` is also defined, `quadratic_soft_max_duration` must be
1346
+ # less than `max_duration`, and the difference must be no larger than one
1347
+ # day:
1348
+ #
1349
+ # `max_duration - quadratic_soft_max_duration <= 86400 seconds`
1350
+ # @!attribute [rw] cost_per_square_hour_after_quadratic_soft_max
1351
+ # @return [::Float]
1352
+ # Cost per square hour incurred if the
1353
+ # `quadratic_soft_max_duration` threshold is violated.
1354
+ #
1355
+ # The additional cost is 0 if the duration is under the threshold,
1356
+ # otherwise the cost depends on the duration as follows:
1357
+ #
1358
+ # ```
1359
+ # cost_per_square_hour_after_quadratic_soft_max *
1360
+ # (duration - quadratic_soft_max_duration)^2
1361
+ # ```
1362
+ #
1363
+ # The cost must be nonnegative.
1364
+ class DurationLimit
1365
+ include ::Google::Protobuf::MessageExts
1366
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1367
+ end
1368
+
1369
+ # @!attribute [rw] key
1370
+ # @return [::String]
1371
+ # @!attribute [rw] value
1372
+ # @return [::Google::Cloud::Optimization::V1::Vehicle::LoadLimit]
1373
+ class LoadLimitsEntry
1374
+ include ::Google::Protobuf::MessageExts
1375
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1376
+ end
1377
+
1378
+ # @!attribute [rw] key
1379
+ # @return [::String]
1380
+ # @!attribute [rw] value
1381
+ # @return [::Google::Protobuf::Duration]
1382
+ class ExtraVisitDurationForVisitTypeEntry
1383
+ include ::Google::Protobuf::MessageExts
1384
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1385
+ end
1386
+
1387
+ # Travel modes which can be used by vehicles.
1388
+ #
1389
+ # These should be a subset of the Google Maps Platform Routes Preferred API
1390
+ # travel modes, see:
1391
+ # https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode.
1392
+ module TravelMode
1393
+ # Unspecified travel mode, equivalent to `DRIVING`.
1394
+ TRAVEL_MODE_UNSPECIFIED = 0
1395
+
1396
+ # Travel mode corresponding to driving directions (car, ...).
1397
+ DRIVING = 1
1398
+ end
1399
+
1400
+ # Policy on how a vehicle can be unloaded. Applies only to shipments having
1401
+ # both a pickup and a delivery.
1402
+ #
1403
+ # Other shipments are free to occur anywhere on the route independent of
1404
+ # `unloading_policy`.
1405
+ module UnloadingPolicy
1406
+ # Unspecified unloading policy; deliveries must just occur after their
1407
+ # corresponding pickups.
1408
+ UNLOADING_POLICY_UNSPECIFIED = 0
1409
+
1410
+ # Deliveries must occur in reverse order of pickups
1411
+ LAST_IN_FIRST_OUT = 1
1412
+
1413
+ # Deliveries must occur in the same order as pickups
1414
+ FIRST_IN_FIRST_OUT = 2
1415
+ end
1416
+ end
1417
+
1418
+ # Time windows constrain the time of an event, such as the arrival time at a
1419
+ # visit, or the start and end time of a vehicle.
1420
+ #
1421
+ # Hard time window bounds, `start_time` and `end_time`, enforce the earliest
1422
+ # and latest time of the event, such that `start_time <= event_time <=
1423
+ # end_time`. The soft time window lower bound, `soft_start_time`, expresses a
1424
+ # preference for the event to happen at or after `soft_start_time` by incurring
1425
+ # a cost proportional to how long before soft_start_time the event occurs. The
1426
+ # soft time window upper bound, `soft_end_time`, expresses a preference for the
1427
+ # event to happen at or before `soft_end_time` by incurring a cost proportional
1428
+ # to how long after `soft_end_time` the event occurs. `start_time`, `end_time`,
1429
+ # `soft_start_time` and `soft_end_time` should be within the global time limits
1430
+ # (see {::Google::Cloud::Optimization::V1::ShipmentModel#global_start_time ShipmentModel.global_start_time} and
1431
+ # {::Google::Cloud::Optimization::V1::ShipmentModel#global_end_time ShipmentModel.global_end_time}) and should respect:
1432
+ # ```
1433
+ # 0 <= `start_time` <= `soft_start_time` <= `end_time` and
1434
+ # 0 <= `start_time` <= `soft_end_time` <= `end_time`.
1435
+ # ```
1436
+ # @!attribute [rw] start_time
1437
+ # @return [::Google::Protobuf::Timestamp]
1438
+ # The hard time window start time. If unspecified it will be set to
1439
+ # `ShipmentModel.global_start_time`.
1440
+ # @!attribute [rw] end_time
1441
+ # @return [::Google::Protobuf::Timestamp]
1442
+ # The hard time window end time. If unspecified it will be set to
1443
+ # `ShipmentModel.global_end_time`.
1444
+ # @!attribute [rw] soft_start_time
1445
+ # @return [::Google::Protobuf::Timestamp]
1446
+ # The soft start time of the time window.
1447
+ # @!attribute [rw] soft_end_time
1448
+ # @return [::Google::Protobuf::Timestamp]
1449
+ # The soft end time of the time window.
1450
+ # @!attribute [rw] cost_per_hour_before_soft_start_time
1451
+ # @return [::Float]
1452
+ # A cost per hour added to other costs in the model if the event occurs
1453
+ # before soft_start_time, computed as:
1454
+ #
1455
+ # ```
1456
+ # max(0, soft_start_time - t.seconds)
1457
+ # * cost_per_hour_before_soft_start_time / 3600,
1458
+ # t being the time of the event.
1459
+ # ```
1460
+ #
1461
+ # This cost must be positive, and the field can only be set if
1462
+ # soft_start_time has been set.
1463
+ # @!attribute [rw] cost_per_hour_after_soft_end_time
1464
+ # @return [::Float]
1465
+ # A cost per hour added to other costs in the model if the event occurs after
1466
+ # `soft_end_time`, computed as:
1467
+ #
1468
+ # ```
1469
+ # max(0, t.seconds - soft_end_time.seconds)
1470
+ # * cost_per_hour_after_soft_end_time / 3600,
1471
+ # t being the time of the event.
1472
+ # ```
1473
+ #
1474
+ # This cost must be positive, and the field can only be set if
1475
+ # `soft_end_time` has been set.
1476
+ class TimeWindow
1477
+ include ::Google::Protobuf::MessageExts
1478
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1479
+ end
1480
+
1481
+ # Deprecated: Use [Shipment.Load][], [Vehicle.LoadLimit][] and [ShipmentRoute.VehicleLoad][] instead.
1482
+ # @!attribute [rw] type
1483
+ # @return [::String]
1484
+ # @!attribute [rw] value
1485
+ # @return [::Integer]
1486
+ class CapacityQuantity
1487
+ include ::Google::Protobuf::MessageExts
1488
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1489
+ end
1490
+
1491
+ # Deprecated: Use [Vehicle.LoadLimit.Interval][] instead.
1492
+ # @!attribute [rw] type
1493
+ # @return [::String]
1494
+ # @!attribute [rw] min_value
1495
+ # @return [::Integer]
1496
+ # @!attribute [rw] max_value
1497
+ # @return [::Integer]
1498
+ class CapacityQuantityInterval
1499
+ include ::Google::Protobuf::MessageExts
1500
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1501
+ end
1502
+
1503
+ # A limit defining a maximum distance which can be traveled. It can be either
1504
+ # hard or soft.
1505
+ #
1506
+ # If a soft limit is defined, both `soft_max_meters` and
1507
+ # `cost_per_kilometer_above_soft_max` must be defined and be nonnegative.
1508
+ # @!attribute [rw] max_meters
1509
+ # @return [::Integer]
1510
+ # A hard limit constraining the distance to be at most max_meters. The limit
1511
+ # must be nonnegative.
1512
+ # @!attribute [rw] soft_max_meters
1513
+ # @return [::Integer]
1514
+ # A soft limit not enforcing a maximum distance limit, but when violated
1515
+ # results in a cost which adds up to other costs defined in the model,
1516
+ # with the same unit.
1517
+ #
1518
+ # If defined soft_max_meters must be less than max_meters and must be
1519
+ # nonnegative.
1520
+ # @!attribute [rw] cost_per_kilometer_above_soft_max
1521
+ # @return [::Float]
1522
+ # Cost per kilometer incurred if `soft_max_meters` limit is violated. The
1523
+ # additional cost is 0 if the distance is under the limit, otherwise the
1524
+ # formula used to compute the cost is the following:
1525
+ # ```
1526
+ # (distance_meters - soft_max_meters) / 1000.0 *
1527
+ # cost_per_kilometer_above_soft_max.
1528
+ # ```
1529
+ # The cost must be nonnegative.
1530
+ class DistanceLimit
1531
+ include ::Google::Protobuf::MessageExts
1532
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1533
+ end
1534
+
1535
+ # Specifies attributes of transitions between two consecutive visits on a
1536
+ # route. Several `TransitionAttributes` may apply to the same transition: in
1537
+ # that case, all extra costs add up and the strictest constraint or limit
1538
+ # applies (following natural "AND" semantics).
1539
+ # @!attribute [rw] src_tag
1540
+ # @return [::String]
1541
+ # Tags defining the set of (src->dst) transitions these attributes apply to.
1542
+ #
1543
+ # A source visit or vehicle start matches iff its
1544
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags VisitRequest.tags}
1545
+ # or {::Google::Cloud::Optimization::V1::Vehicle#start_tags Vehicle.start_tags}
1546
+ # either contains `src_tag` or does not contain `excluded_src_tag` (depending
1547
+ # on which of these two fields is non-empty).
1548
+ # @!attribute [rw] excluded_src_tag
1549
+ # @return [::String]
1550
+ # See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
1551
+ # non-empty.
1552
+ # @!attribute [rw] dst_tag
1553
+ # @return [::String]
1554
+ # A destination visit or vehicle end matches iff its
1555
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#tags VisitRequest.tags}
1556
+ # or {::Google::Cloud::Optimization::V1::Vehicle#end_tags Vehicle.end_tags} either contains `dst_tag` or does not contain
1557
+ # `excluded_dst_tag` (depending on which of these two fields is non-empty).
1558
+ # @!attribute [rw] excluded_dst_tag
1559
+ # @return [::String]
1560
+ # See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
1561
+ # non-empty.
1562
+ # @!attribute [rw] cost
1563
+ # @return [::Float]
1564
+ # Specifies a cost for performing this transition. This is in the same unit
1565
+ # as all other costs in the model and must not be negative. It is applied on
1566
+ # top of all other existing costs.
1567
+ # @!attribute [rw] cost_per_kilometer
1568
+ # @return [::Float]
1569
+ # Specifies a cost per kilometer applied to the distance traveled while
1570
+ # performing this transition. It adds up to any
1571
+ # {::Google::Cloud::Optimization::V1::Vehicle#cost_per_kilometer Vehicle.cost_per_kilometer} specified on vehicles.
1572
+ # @!attribute [rw] distance_limit
1573
+ # @return [::Google::Cloud::Optimization::V1::DistanceLimit]
1574
+ # Specifies a limit on the distance traveled while performing this
1575
+ # transition.
1576
+ #
1577
+ # As of 2021/06, only soft limits are supported.
1578
+ # @!attribute [rw] delay
1579
+ # @return [::Google::Protobuf::Duration]
1580
+ # Specifies a delay incurred when performing this transition.
1581
+ #
1582
+ # This delay always occurs *after* finishing the source visit and *before*
1583
+ # starting the destination visit.
1584
+ class TransitionAttributes
1585
+ include ::Google::Protobuf::MessageExts
1586
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1587
+ end
1588
+
1589
+ # Encapsulates a waypoint. Waypoints mark arrival and departure locations of
1590
+ # VisitRequests, and start and end locations of Vehicles.
1591
+ # @!attribute [rw] location
1592
+ # @return [::Google::Cloud::Optimization::V1::Location]
1593
+ # A point specified using geographic coordinates, including an optional
1594
+ # heading.
1595
+ # @!attribute [rw] place_id
1596
+ # @return [::String]
1597
+ # The POI Place ID associated with the waypoint.
1598
+ # @!attribute [rw] side_of_road
1599
+ # @return [::Boolean]
1600
+ # Indicates that the location of this waypoint is meant to have a preference
1601
+ # for the vehicle to stop at a particular side of road. When you set this
1602
+ # value, the route will pass through the location so that the vehicle can
1603
+ # stop at the side of road that the location is biased towards from the
1604
+ # center of the road. This option works only for the 'DRIVING' travel mode,
1605
+ # and when the 'location_type' is set to 'location'.
1606
+ class Waypoint
1607
+ include ::Google::Protobuf::MessageExts
1608
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1609
+ end
1610
+
1611
+ # Encapsulates a location (a geographic point, and an optional heading).
1612
+ # @!attribute [rw] lat_lng
1613
+ # @return [::Google::Type::LatLng]
1614
+ # The waypoint's geographic coordinates.
1615
+ # @!attribute [rw] heading
1616
+ # @return [::Integer]
1617
+ # The compass heading associated with the direction of the flow of traffic.
1618
+ # This value is used to specify the side of the road to use for pickup and
1619
+ # drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
1620
+ # of due North, 90 specifies a heading of due East, etc.
1621
+ class Location
1622
+ include ::Google::Protobuf::MessageExts
1623
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1624
+ end
1625
+
1626
+ # Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break
1627
+ # is a contiguous period of time during which the vehicle remains idle at its
1628
+ # current position and cannot perform any visit. A break may occur:
1629
+ #
1630
+ # * during the travel between two visits (which includes the time right
1631
+ # before or right after a visit, but not in the middle of a visit), in
1632
+ # which case it extends the corresponding transit time between the visits,
1633
+ # * or before the vehicle start (the vehicle may not start in the middle of
1634
+ # a break), in which case it does not affect the vehicle start time.
1635
+ # * or after the vehicle end (ditto, with the vehicle end time).
1636
+ # @!attribute [rw] break_requests
1637
+ # @return [::Array<::Google::Cloud::Optimization::V1::BreakRule::BreakRequest>]
1638
+ # Sequence of breaks. See the `BreakRequest` message.
1639
+ # @!attribute [rw] frequency_constraints
1640
+ # @return [::Array<::Google::Cloud::Optimization::V1::BreakRule::FrequencyConstraint>]
1641
+ # Several `FrequencyConstraint` may apply. They must all be satisfied by
1642
+ # the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
1643
+ class BreakRule
1644
+ include ::Google::Protobuf::MessageExts
1645
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1646
+
1647
+ # The sequence of breaks (i.e. their number and order) that apply to each
1648
+ # vehicle must be known beforehand. The repeated `BreakRequest`s define
1649
+ # that sequence, in the order in which they must occur. Their time windows
1650
+ # (`earliest_start_time` / `latest_start_time`) may overlap, but they must
1651
+ # be compatible with the order (this is checked).
1652
+ # @!attribute [rw] earliest_start_time
1653
+ # @return [::Google::Protobuf::Timestamp]
1654
+ # Required. Lower bound (inclusive) on the start of the break.
1655
+ # @!attribute [rw] latest_start_time
1656
+ # @return [::Google::Protobuf::Timestamp]
1657
+ # Required. Upper bound (inclusive) on the start of the break.
1658
+ # @!attribute [rw] min_duration
1659
+ # @return [::Google::Protobuf::Duration]
1660
+ # Required. Minimum duration of the break. Must be positive.
1661
+ class BreakRequest
1662
+ include ::Google::Protobuf::MessageExts
1663
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1664
+ end
1665
+
1666
+ # One may further constrain the frequency and duration of the breaks
1667
+ # specified above, by enforcing a minimum break frequency, such as
1668
+ # "There must be a break of at least 1 hour every 12 hours". Assuming that
1669
+ # this can be interpreted as "Within any sliding time window of 12h, there
1670
+ # must be at least one break of at least one hour", that example would
1671
+ # translate to the following `FrequencyConstraint`:
1672
+ # ```
1673
+ # {
1674
+ # min_break_duration { seconds: 3600 } # 1 hour.
1675
+ # max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).
1676
+ # }
1677
+ # ```
1678
+ #
1679
+ # The timing and duration of the breaks in the solution will respect all
1680
+ # such constraints, in addition to the time windows and minimum durations
1681
+ # already specified in the `BreakRequest`.
1682
+ #
1683
+ # A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
1684
+ # For example, the following schedule honors the "1h every 12h" example:
1685
+ # ```
1686
+ # 04:00 vehicle start
1687
+ # .. performing travel and visits ..
1688
+ # 09:00 1 hour break
1689
+ # 10:00 end of the break
1690
+ # .. performing travel and visits ..
1691
+ # 12:00 20-min lunch break
1692
+ # 12:20 end of the break
1693
+ # .. performing travel and visits ..
1694
+ # 21:00 1 hour break
1695
+ # 22:00 end of the break
1696
+ # .. performing travel and visits ..
1697
+ # 23:59 vehicle end
1698
+ # ```
1699
+ # @!attribute [rw] min_break_duration
1700
+ # @return [::Google::Protobuf::Duration]
1701
+ # Required. Minimum break duration for this constraint. Nonnegative.
1702
+ # See description of `FrequencyConstraint`.
1703
+ # @!attribute [rw] max_inter_break_duration
1704
+ # @return [::Google::Protobuf::Duration]
1705
+ # Required. Maximum allowed span of any interval of time in the route that does not
1706
+ # include at least partially a break of `duration >=
1707
+ # min_break_duration`. Must be positive.
1708
+ class FrequencyConstraint
1709
+ include ::Google::Protobuf::MessageExts
1710
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1711
+ end
1712
+ end
1713
+
1714
+ # A vehicle's route can be decomposed, along the time axis, like this (we
1715
+ # assume there are n visits):
1716
+ # ```
1717
+ # | | | | | T[2], | | |
1718
+ # | Transition | Visit #0 | | | V[2], | | |
1719
+ # | #0 | aka | T[1] | V[1] | ... | V[n-1] | T[n] |
1720
+ # | aka T[0] | V[0] | | | V[n-2],| | |
1721
+ # | | | | | T[n-1] | | |
1722
+ # ^ ^ ^ ^ ^ ^ ^ ^
1723
+ # vehicle V[0].start V[0].end V[1]. V[1]. V[n]. V[n]. vehicle
1724
+ # start (arrival) (departure) start end start end end
1725
+ # ```
1726
+ # Note that we make a difference between:
1727
+ #
1728
+ # * "punctual events", such as the vehicle start and end and each visit's start
1729
+ # and end (aka arrival and departure). They happen at a given second.
1730
+ # * "time intervals", such as the visits themselves, and the transition between
1731
+ # visits. Though time intervals can sometimes have zero duration, i.e. start
1732
+ # and end at the same second, they often have a positive duration.
1733
+ #
1734
+ # Invariants:
1735
+ #
1736
+ # * If there are n visits, there are n+1 transitions.
1737
+ # * A visit is always surrounded by a transition before it (same index) and a
1738
+ # transition after it (index + 1).
1739
+ # * The vehicle start is always followed by transition #0.
1740
+ # * The vehicle end is always preceded by transition #n.
1741
+ #
1742
+ # Zooming in, here is what happens during a `Transition` and a `Visit`:
1743
+ # ```
1744
+ # ---+-------------------------------------+-----------------------------+-->
1745
+ # | TRANSITION[i] | VISIT[i] |
1746
+ # | | |
1747
+ # | * TRAVEL: the vehicle moves from | PERFORM the visit: |
1748
+ # | VISIT[i-1].departure_location to | |
1749
+ # | VISIT[i].arrival_location, which | * Spend some time: |
1750
+ # | takes a given travel duration | the "visit duration". |
1751
+ # | and distance | |
1752
+ # | | * Load or unload |
1753
+ # | * BREAKS: the driver may have | some quantities from the |
1754
+ # | breaks (e.g. lunch break). | vehicle: the "demand". |
1755
+ # | | |
1756
+ # | * WAIT: the driver/vehicle does | |
1757
+ # | nothing. This can happen for | |
1758
+ # | many reasons, for example when | |
1759
+ # | the vehicle reaches the next | |
1760
+ # | event's destination before the | |
1761
+ # | start of its time window | |
1762
+ # | | |
1763
+ # | * DELAY: *right before* the next | |
1764
+ # | arrival. E.g. the vehicle and/or | |
1765
+ # | driver spends time unloading. | |
1766
+ # | | |
1767
+ # ---+-------------------------------------+-----------------------------+-->
1768
+ # ^ ^ ^
1769
+ # V[i-1].end V[i].start V[i].end
1770
+ # ```
1771
+ # Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged
1772
+ # during a transition.
1773
+ #
1774
+ # * They don't overlap.
1775
+ # * The DELAY is unique and *must* be a contiguous period of time right
1776
+ # before the next visit (or vehicle end). Thus, it suffice to know the
1777
+ # delay duration to know its start and end time.
1778
+ # * The BREAKS are contiguous, non-overlapping periods of time. The
1779
+ # response specifies the start time and duration of each break.
1780
+ # * TRAVEL and WAIT are "preemptable": they can be interrupted several times
1781
+ # during this transition. Clients can assume that travel happens "as soon as
1782
+ # possible" and that "wait" fills the remaining time.
1783
+ #
1784
+ # A (complex) example:
1785
+ # ```
1786
+ # TRANSITION[i]
1787
+ # --++-----+-----------------------------------------------------------++-->
1788
+ # || | | | | | | ||
1789
+ # || T | B | T | | B | | D ||
1790
+ # || r | r | r | W | r | W | e ||
1791
+ # || a | e | a | a | e | a | l ||
1792
+ # || v | a | v | i | a | i | a ||
1793
+ # || e | k | e | t | k | t | y ||
1794
+ # || l | | l | | | | ||
1795
+ # || | | | | | | ||
1796
+ # --++-----------------------------------------------------------------++-->
1797
+ # ```
1798
+ # @!attribute [rw] vehicle_index
1799
+ # @return [::Integer]
1800
+ # Vehicle performing the route, identified by its index in the source
1801
+ # `ShipmentModel`.
1802
+ # @!attribute [rw] vehicle_label
1803
+ # @return [::String]
1804
+ # Label of the vehicle performing this route, equal to
1805
+ # `ShipmentModel.vehicles(vehicle_index).label`, if specified.
1806
+ # @!attribute [rw] vehicle_start_time
1807
+ # @return [::Google::Protobuf::Timestamp]
1808
+ # Time at which the vehicle starts its route.
1809
+ # @!attribute [rw] vehicle_end_time
1810
+ # @return [::Google::Protobuf::Timestamp]
1811
+ # Time at which the vehicle finishes its route.
1812
+ # @!attribute [rw] visits
1813
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Visit>]
1814
+ # Ordered sequence of visits representing a route.
1815
+ # visits[i] is the i-th visit in the route.
1816
+ # If this field is empty, the vehicle is considered as unused.
1817
+ # @!attribute [rw] transitions
1818
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Transition>]
1819
+ # Ordered list of transitions for the route.
1820
+ # @!attribute [rw] has_traffic_infeasibilities
1821
+ # @return [::Boolean]
1822
+ # When
1823
+ # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
1824
+ # is set to true, this field indicates that inconsistencies in route timings
1825
+ # are predicted using traffic-based travel duration estimates. There may be
1826
+ # insufficient time to complete traffic-adjusted travel, delays, and breaks
1827
+ # between visits, before the first visit, or after the last visit, while
1828
+ # still satisfying the visit and vehicle time windows. For example,
1829
+ #
1830
+ # ```start_time(previous_visit) + duration(previous_visit) +
1831
+ # travel_duration(previous_visit, next_visit) > start_time(next_visit)```
1832
+ #
1833
+ # Arrival at next_visit will likely happen later than its current
1834
+ # time window due the increased estimate of travel time
1835
+ # `travel_duration(previous_visit, next_visit)` due to traffic. Also, a break
1836
+ # may be forced to overlap with a visit due to an increase in travel time
1837
+ # estimates and visit or break time window restrictions.
1838
+ # @!attribute [rw] route_polyline
1839
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
1840
+ # The encoded polyline representation of the route.
1841
+ # This field is only populated if
1842
+ # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_polylines OptimizeToursRequest.populate_polylines}
1843
+ # is set to true.
1844
+ # @!attribute [rw] breaks
1845
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Break>]
1846
+ # Breaks scheduled for the vehicle performing this route.
1847
+ # The `breaks` sequence represents time intervals, each starting at the
1848
+ # corresponding `start_time` and lasting `duration` seconds.
1849
+ # @!attribute [rw] metrics
1850
+ # @return [::Google::Cloud::Optimization::V1::AggregatedMetrics]
1851
+ # Duration, distance and load metrics for this route. The fields of
1852
+ # {::Google::Cloud::Optimization::V1::AggregatedMetrics AggregatedMetrics} are summed over all {::Google::Cloud::Optimization::V1::ShipmentRoute#transitions ShipmentRoute.transitions} or
1853
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#visits ShipmentRoute.visits}, depending on the context.
1854
+ # @!attribute [rw] route_costs
1855
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
1856
+ # Cost of the route, broken down by cost-related request fields.
1857
+ # The keys are proto paths, relative to the input OptimizeToursRequest, e.g.
1858
+ # "model.shipments.pickups.cost", and the values are the total cost
1859
+ # generated by the corresponding cost field, aggregated over the whole route.
1860
+ # In other words, costs["model.shipments.pickups.cost"] is the sum of all
1861
+ # pickup costs over the route. All costs defined in the model are reported in
1862
+ # detail here with the exception of costs related to TransitionAttributes
1863
+ # that are only reported in an aggregated way as of 2022/01.
1864
+ # @!attribute [rw] route_total_cost
1865
+ # @return [::Float]
1866
+ # Total cost of the route. The sum of all costs in the cost map.
1867
+ # @!attribute [rw] end_loads
1868
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
1869
+ # Deprecated: Use [ShipmentRoute.Transition.loads][] instead.
1870
+ # Vehicle loads upon arrival at its end location, for each
1871
+ # type specified in {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
1872
+ # `start_load_intervals`, `end_load_intervals` or demands. Exception: we omit
1873
+ # loads for quantity types unconstrained by intervals and that don't have any
1874
+ # non-zero demand on the route.
1875
+ # @!attribute [rw] travel_steps
1876
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::TravelStep>]
1877
+ # Deprecated: Use [ShipmentRoute.Transition][] instead.
1878
+ # Ordered list of travel steps for the route.
1879
+ # @!attribute [rw] vehicle_detour
1880
+ # @return [::Google::Protobuf::Duration]
1881
+ # Deprecated: No longer used.
1882
+ # This field will only be populated at the
1883
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit ShipmentRoute.Visit} level.
1884
+ # Extra detour time due to the shipments visited on the route.
1885
+ #
1886
+ # It is equal to `vehicle_end_time` - `vehicle_start_time` - travel duration
1887
+ # from the vehicle's start_location to its `end_location`.
1888
+ # @!attribute [rw] delay_before_vehicle_end
1889
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
1890
+ # Deprecated: Use [ShipmentRoute.Transition.delay_duration][] instead.
1891
+ # Delay occurring before the vehicle end. See
1892
+ # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
1893
+ class ShipmentRoute
1894
+ include ::Google::Protobuf::MessageExts
1895
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1896
+
1897
+ # Deprecated: Use [ShipmentRoute.Transition.delay_duration][] instead.
1898
+ # Time interval spent on the route resulting from a
1899
+ # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
1900
+ # @!attribute [rw] start_time
1901
+ # @return [::Google::Protobuf::Timestamp]
1902
+ # Start of the delay.
1903
+ # @!attribute [rw] duration
1904
+ # @return [::Google::Protobuf::Duration]
1905
+ # Duration of the delay.
1906
+ class Delay
1907
+ include ::Google::Protobuf::MessageExts
1908
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1909
+ end
1910
+
1911
+ # A visit performed during a route. This visit corresponds to a pickup or a
1912
+ # delivery of a `Shipment`.
1913
+ # @!attribute [rw] shipment_index
1914
+ # @return [::Integer]
1915
+ # Index of the `shipments` field in the source {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
1916
+ # @!attribute [rw] is_pickup
1917
+ # @return [::Boolean]
1918
+ # If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
1919
+ # corresponds to a delivery.
1920
+ # @!attribute [rw] visit_request_index
1921
+ # @return [::Integer]
1922
+ # Index of `VisitRequest` in either the pickup or delivery field of the
1923
+ # `Shipment` (see `is_pickup`).
1924
+ # @!attribute [rw] start_time
1925
+ # @return [::Google::Protobuf::Timestamp]
1926
+ # Time at which the visit starts. Note that the vehicle may arrive earlier
1927
+ # than this at the visit location. Times are consistent with the
1928
+ # `ShipmentModel`.
1929
+ # @!attribute [rw] load_demands
1930
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
1931
+ # Total visit load demand as the sum of the shipment and the visit request
1932
+ # `load_demands`. The values are negative if the visit is a delivery.
1933
+ # Demands are reported for the same types as the
1934
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
1935
+ # (see this field).
1936
+ # @!attribute [rw] detour
1937
+ # @return [::Google::Protobuf::Duration]
1938
+ # Extra detour time due to the shipments visited on the route before the
1939
+ # visit and to the potential waiting time induced by time windows.
1940
+ # If the visit is a delivery, the detour is computed from the corresponding
1941
+ # pickup visit and is equal to:
1942
+ # ```
1943
+ # start_time(delivery) - start_time(pickup)
1944
+ # - (duration(pickup) + travel duration from the pickup location
1945
+ # to the delivery location).
1946
+ # ```
1947
+ # Otherwise, it is computed from the vehicle `start_location` and is equal
1948
+ # to:
1949
+ # ```
1950
+ # start_time - vehicle_start_time - travel duration from
1951
+ # the vehicle's `start_location` to the visit.
1952
+ # ```
1953
+ # @!attribute [rw] shipment_label
1954
+ # @return [::String]
1955
+ # Copy of the corresponding `Shipment.label`, if specified in the
1956
+ # `Shipment`.
1957
+ # @!attribute [rw] visit_label
1958
+ # @return [::String]
1959
+ # Copy of the corresponding
1960
+ # {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
1961
+ # if specified in the `VisitRequest`.
1962
+ # @!attribute [rw] arrival_loads
1963
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
1964
+ # Deprecated: Use [ShipmentRoute.Transition.loads][] instead.
1965
+ # Vehicle loads upon arrival at the visit location, for each
1966
+ # type specified in {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities}, `start_load_intervals`,
1967
+ # `end_load_intervals` or `demands`.
1968
+ #
1969
+ # Exception: we omit loads for quantity types unconstrained by intervals
1970
+ # and that don't have any non-zero demand on the route.
1971
+ # @!attribute [rw] delay_before_start
1972
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
1973
+ # Deprecated: Use [ShipmentRoute.Transition.delay_duration][] instead.
1974
+ # @!attribute [rw] demands
1975
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
1976
+ # Deprecated: Use [Visit.load_demands][] instead.
1977
+ class Visit
1978
+ include ::Google::Protobuf::MessageExts
1979
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1980
+
1981
+ # @!attribute [rw] key
1982
+ # @return [::String]
1983
+ # @!attribute [rw] value
1984
+ # @return [::Google::Cloud::Optimization::V1::Shipment::Load]
1985
+ class LoadDemandsEntry
1986
+ include ::Google::Protobuf::MessageExts
1987
+ extend ::Google::Protobuf::MessageExts::ClassMethods
1988
+ end
1989
+ end
1990
+
1991
+ # Transition between two events on the route. See the description of
1992
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
1993
+ #
1994
+ # If the vehicle does not have a `start_location` and/or `end_location`, the
1995
+ # corresponding travel metrics are 0.
1996
+ # @!attribute [rw] travel_duration
1997
+ # @return [::Google::Protobuf::Duration]
1998
+ # Travel duration during this transition.
1999
+ # @!attribute [rw] travel_distance_meters
2000
+ # @return [::Float]
2001
+ # Distance traveled during the transition.
2002
+ # @!attribute [rw] traffic_info_unavailable
2003
+ # @return [::Boolean]
2004
+ # When traffic is requested via
2005
+ # [OptimizeToursRequest.consider_road_traffic]
2006
+ # [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
2007
+ # and the traffic info couldn't be retrieved for a `Transition`, this
2008
+ # boolean is set to true. This may be temporary (rare hiccup in the
2009
+ # realtime traffic servers) or permanent (no data for this location).
2010
+ # @!attribute [rw] delay_duration
2011
+ # @return [::Google::Protobuf::Duration]
2012
+ # Sum of the delay durations applied to this transition. If any, the delay
2013
+ # starts exactly `delay_duration` seconds before the next event (visit or
2014
+ # vehicle end). See
2015
+ # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
2016
+ # @!attribute [rw] break_duration
2017
+ # @return [::Google::Protobuf::Duration]
2018
+ # Sum of the duration of the breaks occurring during this transition, if
2019
+ # any. Details about each break's start time and duration are stored in
2020
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
2021
+ # @!attribute [rw] wait_duration
2022
+ # @return [::Google::Protobuf::Duration]
2023
+ # Time spent waiting during this transition. Wait duration corresponds to
2024
+ # idle time and does not include break time. Also note that this wait time
2025
+ # may be split into several non-contiguous intervals.
2026
+ # @!attribute [rw] total_duration
2027
+ # @return [::Google::Protobuf::Duration]
2028
+ # Total duration of the transition, provided for convenience. It is equal
2029
+ # to:
2030
+ #
2031
+ # * next visit `start_time` (or `vehicle_end_time` if this is the last
2032
+ # transition) - this transition's `start_time`;
2033
+ # * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
2034
+ # additionally holds: `total_duration = travel_duration + delay_duration
2035
+ # + break_duration + wait_duration`.
2036
+ # @!attribute [rw] start_time
2037
+ # @return [::Google::Protobuf::Timestamp]
2038
+ # Start time of this transition.
2039
+ # @!attribute [rw] route_polyline
2040
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
2041
+ # The encoded polyline representation of the route followed during the
2042
+ # transition.
2043
+ # This field is only populated if [populate_transition_polylines]
2044
+ # [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
2045
+ # is set to true.
2046
+ # @!attribute [rw] vehicle_loads
2047
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
2048
+ # Vehicle loads during this transition, for each type that either appears
2049
+ # in this vehicle's {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits}, or that have non-zero
2050
+ # {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands} on some shipment performed on this route.
2051
+ #
2052
+ # The loads during the first transition are the starting loads of the
2053
+ # vehicle route. Then, after each visit, the visit's `load_demands` are
2054
+ # either added or subtracted to get the next transition's loads, depending
2055
+ # on whether the visit was a pickup or a delivery.
2056
+ # @!attribute [rw] loads
2057
+ # @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
2058
+ # Deprecated: Use [Transition.vehicle_loads][] instead.
2059
+ class Transition
2060
+ include ::Google::Protobuf::MessageExts
2061
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2062
+
2063
+ # @!attribute [rw] key
2064
+ # @return [::String]
2065
+ # @!attribute [rw] value
2066
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
2067
+ class VehicleLoadsEntry
2068
+ include ::Google::Protobuf::MessageExts
2069
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2070
+ end
2071
+ end
2072
+
2073
+ # Reports the actual load of the vehicle at some point along the route,
2074
+ # for a given type (see {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
2075
+ # @!attribute [rw] amount
2076
+ # @return [::Integer]
2077
+ # The amount of load on the vehicle, for the given type. The unit of load
2078
+ # is usually indicated by the type. See {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
2079
+ class VehicleLoad
2080
+ include ::Google::Protobuf::MessageExts
2081
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2082
+ end
2083
+
2084
+ # The encoded representation of a polyline. More information on polyline
2085
+ # encoding can be found here:
2086
+ # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
2087
+ # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
2088
+ # @!attribute [rw] points
2089
+ # @return [::String]
2090
+ # String representing encoded points of the polyline.
2091
+ class EncodedPolyline
2092
+ include ::Google::Protobuf::MessageExts
2093
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2094
+ end
2095
+
2096
+ # Data representing the execution of a break.
2097
+ # @!attribute [rw] start_time
2098
+ # @return [::Google::Protobuf::Timestamp]
2099
+ # Start time of a break.
2100
+ # @!attribute [rw] duration
2101
+ # @return [::Google::Protobuf::Duration]
2102
+ # Duration of a break.
2103
+ class Break
2104
+ include ::Google::Protobuf::MessageExts
2105
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2106
+ end
2107
+
2108
+ # Deprecated: Use [ShipmentRoute.transitions][] instead.
2109
+ # Travel between each visit, along the route: from the
2110
+ # vehicle's `start_location` to the first visit's `arrival_location`, then
2111
+ # from the first visit's `departure_location` to the second visit's
2112
+ # `arrival_location`, and so on until the vehicle's `end_location`. This
2113
+ # accounts only for the actual travel between visits, not counting the
2114
+ # waiting time, the time spent performing a visit, nor the distance covered
2115
+ # during a visit.
2116
+ #
2117
+ # Invariant: `travel_steps_size() == visits_size() + 1`.
2118
+ #
2119
+ # If the vehicle does not have a start_ and/or end_location, the
2120
+ # corresponding travel metrics are 0 and/or empty.
2121
+ # @!attribute [rw] duration
2122
+ # @return [::Google::Protobuf::Duration]
2123
+ # Duration of the travel step.
2124
+ # @!attribute [rw] distance_meters
2125
+ # @return [::Float]
2126
+ # Distance traveled during the step.
2127
+ # @!attribute [rw] traffic_info_unavailable
2128
+ # @return [::Boolean]
2129
+ # When traffic is requested via
2130
+ # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
2131
+ # and the traffic info couldn't be retrieved for a TravelStep, this boolean
2132
+ # is set to true. This may be temporary (rare hiccup in the realtime
2133
+ # traffic servers) or permanent (no data for this location).
2134
+ # @!attribute [rw] route_polyline
2135
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
2136
+ # The encoded polyline representation of the route followed during the
2137
+ # step.
2138
+ #
2139
+ # This field is only populated if
2140
+ # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
2141
+ # is set to true.
2142
+ class TravelStep
2143
+ include ::Google::Protobuf::MessageExts
2144
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2145
+ end
2146
+
2147
+ # @!attribute [rw] key
2148
+ # @return [::String]
2149
+ # @!attribute [rw] value
2150
+ # @return [::Float]
2151
+ class RouteCostsEntry
2152
+ include ::Google::Protobuf::MessageExts
2153
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2154
+ end
2155
+ end
2156
+
2157
+ # Specifies details of unperformed shipments in a solution. For trivial cases
2158
+ # and/or if we are able to identify the cause for skipping, we report the
2159
+ # reason here.
2160
+ # @!attribute [rw] index
2161
+ # @return [::Integer]
2162
+ # The index corresponds to the index of the shipment in the source
2163
+ # `ShipmentModel`.
2164
+ # @!attribute [rw] label
2165
+ # @return [::String]
2166
+ # Copy of the corresponding {::Google::Cloud::Optimization::V1::Shipment#label Shipment.label}, if specified in the
2167
+ # `Shipment`.
2168
+ # @!attribute [rw] reasons
2169
+ # @return [::Array<::Google::Cloud::Optimization::V1::SkippedShipment::Reason>]
2170
+ # A list of reasons that explain why the shipment was skipped. See comment
2171
+ # above `Reason`.
2172
+ class SkippedShipment
2173
+ include ::Google::Protobuf::MessageExts
2174
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2175
+
2176
+ # If we can explain why the shipment was skipped, reasons will be listed
2177
+ # here. If the reason is not the same for all vehicles, `reason` will have
2178
+ # more than 1 element. A skipped shipment cannot have duplicate reasons,
2179
+ # i.e. where all fields are the same except for `example_vehicle_index`.
2180
+ # Example:
2181
+ # ```
2182
+ # reasons {
2183
+ # code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
2184
+ # example_vehicle_index: 1
2185
+ # example_exceeded_capacity_type: "Apples"
2186
+ # }
2187
+ # reasons {
2188
+ # code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
2189
+ # example_vehicle_index: 3
2190
+ # example_exceeded_capacity_type: "Pears"
2191
+ # }
2192
+ # reasons {
2193
+ # code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
2194
+ # example_vehicle_index: 1
2195
+ # }
2196
+ # ```
2197
+ # The skipped shipment is incompatible with all vehicles. The reasons may
2198
+ # be different for all vehicles but at least one vehicle's "Apples"
2199
+ # capacity would be exceeded (including vehicle 1), at least one vehicle's
2200
+ # "Pears" capacity would be exceeded (including vehicle 3) and at least one
2201
+ # vehicle's distance limit would be exceeded (including vehicle 1).
2202
+ # @!attribute [rw] code
2203
+ # @return [::Google::Cloud::Optimization::V1::SkippedShipment::Reason::Code]
2204
+ # Refer to the comments of Code.
2205
+ # @!attribute [rw] example_vehicle_index
2206
+ # @return [::Integer]
2207
+ # If the reason is related to a shipment-vehicle incompatibility, this
2208
+ # field provides the index of one relevant vehicle.
2209
+ # @!attribute [rw] example_exceeded_capacity_type
2210
+ # @return [::String]
2211
+ # If the reason code is `DEMAND_EXCEEDS_VEHICLE_CAPACITY`, documents one
2212
+ # capacity type that is exceeded.
2213
+ class Reason
2214
+ include ::Google::Protobuf::MessageExts
2215
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2216
+
2217
+ # Code identifying the reason type. The order here is meaningless. In
2218
+ # particular, it gives no indication of whether a given reason will
2219
+ # appear before another in the solution, if both apply.
2220
+ module Code
2221
+ # This should never be used. If we are unable to understand why a
2222
+ # shipment was skipped, we simply return an empty set of reasons.
2223
+ CODE_UNSPECIFIED = 0
2224
+
2225
+ # There is no vehicle in the model making all shipments infeasible.
2226
+ NO_VEHICLE = 1
2227
+
2228
+ # The demand of the shipment exceeds a vehicle's capacity for some
2229
+ # capacity types, one of which is `example_exceeded_capacity_type`.
2230
+ DEMAND_EXCEEDS_VEHICLE_CAPACITY = 2
2231
+
2232
+ # The minimum distance necessary to perform this shipment, i.e. from
2233
+ # the vehicle's `start_location` to the shipment's pickup and/or delivery
2234
+ # locations and to the vehicle's end location exceeds the vehicle's
2235
+ # `route_distance_limit`.
2236
+ #
2237
+ # Note that for this computation we use the geodesic distances.
2238
+ CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT = 3
2239
+
2240
+ # The minimum time necessary to perform this shipment, including travel
2241
+ # time, wait time and service time exceeds the vehicle's
2242
+ # `route_duration_limit`.
2243
+ #
2244
+ # Note: travel time is computed in the best-case scenario, namely as
2245
+ # geodesic distance x 36 m/s (roughly 130 km/hour).
2246
+ CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT = 4
2247
+
2248
+ # Same as above but we only compare minimum travel time and the
2249
+ # vehicle's `travel_duration_limit`.
2250
+ CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT = 5
2251
+
2252
+ # The vehicle cannot perform this shipment in the best-case scenario
2253
+ # (see `CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT` for time
2254
+ # computation) if it starts at its earliest start time: the total time
2255
+ # would make the vehicle end after its latest end time.
2256
+ CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS = 6
2257
+
2258
+ # The `allowed_vehicle_indices` field of the shipment is not empty and
2259
+ # this vehicle does not belong to it.
2260
+ VEHICLE_NOT_ALLOWED = 7
2261
+ end
2262
+ end
2263
+ end
2264
+
2265
+ # Aggregated metrics for {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute} (resp. for {::Google::Cloud::Optimization::V1::OptimizeToursResponse OptimizeToursResponse}
2266
+ # over all {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition}
2267
+ # and/or {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit Visit} (resp. over
2268
+ # all {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}) elements.
2269
+ # @!attribute [rw] performed_shipment_count
2270
+ # @return [::Integer]
2271
+ # Number of shipments performed. Note that a pickup and delivery pair only
2272
+ # counts once.
2273
+ # @!attribute [rw] travel_duration
2274
+ # @return [::Google::Protobuf::Duration]
2275
+ # Total travel duration for a route or a solution.
2276
+ # @!attribute [rw] wait_duration
2277
+ # @return [::Google::Protobuf::Duration]
2278
+ # Total wait duration for a route or a solution.
2279
+ # @!attribute [rw] delay_duration
2280
+ # @return [::Google::Protobuf::Duration]
2281
+ # Total delay duration for a route or a solution.
2282
+ # @!attribute [rw] break_duration
2283
+ # @return [::Google::Protobuf::Duration]
2284
+ # Total break duration for a route or a solution.
2285
+ # @!attribute [rw] visit_duration
2286
+ # @return [::Google::Protobuf::Duration]
2287
+ # Total visit duration for a route or a solution.
2288
+ # @!attribute [rw] total_duration
2289
+ # @return [::Google::Protobuf::Duration]
2290
+ # The total duration should be equal to the sum of all durations above.
2291
+ # For routes, it also corresponds to {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_end_time ShipmentRoute.vehicle_end_time} -
2292
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_start_time ShipmentRoute.vehicle_start_time}.
2293
+ # @!attribute [rw] travel_distance_meters
2294
+ # @return [::Float]
2295
+ # Total travel distance for a route or a solution.
2296
+ # @!attribute [rw] max_loads
2297
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
2298
+ # Maximum load achieved over the entire route (resp. solution), for each of
2299
+ # the quantities on this route (resp. solution), computed as the maximum over
2300
+ # all
2301
+ # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
2302
+ # (resp.
2303
+ # {::Google::Cloud::Optimization::V1::AggregatedMetrics#max_loads ShipmentRoute.metrics.max_loads}.
2304
+ # @!attribute [rw] costs
2305
+ # @return [::Google::Protobuf::Map{::String => ::Float}]
2306
+ # Deprecated: Use [ShipmentRoute.route_costs][] and [OptimizeToursResponse.Metrics.costs][] instead.
2307
+ # @!attribute [rw] total_cost
2308
+ # @return [::Float]
2309
+ # Deprecated: Use [ShipmentRoute.route_total_cost][] and [OptimizeToursResponse.Metrics.total_cost][] instead.
2310
+ class AggregatedMetrics
2311
+ include ::Google::Protobuf::MessageExts
2312
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2313
+
2314
+ # @!attribute [rw] key
2315
+ # @return [::String]
2316
+ # @!attribute [rw] value
2317
+ # @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
2318
+ class MaxLoadsEntry
2319
+ include ::Google::Protobuf::MessageExts
2320
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2321
+ end
2322
+
2323
+ # @!attribute [rw] key
2324
+ # @return [::String]
2325
+ # @!attribute [rw] value
2326
+ # @return [::Float]
2327
+ class CostsEntry
2328
+ include ::Google::Protobuf::MessageExts
2329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2330
+ end
2331
+ end
2332
+
2333
+ # Solution injected in the request including information about which visits
2334
+ # must be constrained and how they must be constrained.
2335
+ # @!attribute [rw] routes
2336
+ # @return [::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>]
2337
+ # Routes of the solution to inject. Some routes may be omitted from the
2338
+ # original solution. The routes and skipped shipments must satisfy the basic
2339
+ # validity assumptions listed for `injected_first_solution_routes`.
2340
+ # @!attribute [rw] skipped_shipments
2341
+ # @return [::Array<::Google::Cloud::Optimization::V1::SkippedShipment>]
2342
+ # Skipped shipments of the solution to inject. Some may be omitted from the
2343
+ # original solution. See the `routes` field.
2344
+ # @!attribute [rw] constraint_relaxations
2345
+ # @return [::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation>]
2346
+ # For zero or more groups of vehicles, specifies when and how much to relax
2347
+ # constraints. If this field is empty, all non-empty vehicle routes are
2348
+ # fully constrained.
2349
+ class InjectedSolutionConstraint
2350
+ include ::Google::Protobuf::MessageExts
2351
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2352
+
2353
+ # For a group of vehicles, specifies at what threshold(s) constraints on
2354
+ # visits will be relaxed and to which level. Shipments listed in
2355
+ # the `skipped_shipment` field are constrained to be skipped; i.e., they
2356
+ # cannot be performed.
2357
+ # @!attribute [rw] relaxations
2358
+ # @return [::Array<::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation>]
2359
+ # All the visit constraint relaxations that will apply to visits on
2360
+ # routes with vehicles in `vehicle_indices`.
2361
+ # @!attribute [rw] vehicle_indices
2362
+ # @return [::Array<::Integer>]
2363
+ # Specifies the vehicle indices to which the visit constraint
2364
+ # `relaxations` apply. If empty, this is considered the default and the
2365
+ # `relaxations` apply to all vehicles that are not specified in other
2366
+ # `constraint_relaxations`. There can be at most one default, i.e., at
2367
+ # most one constraint relaxation field is allowed empty
2368
+ # `vehicle_indices`. A vehicle index can only be listed once, even within
2369
+ # several `constraint_relaxations`.
2370
+ #
2371
+ # A vehicle index is mapped the same as {::Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_index ShipmentRoute.vehicle_index}, if
2372
+ # `interpret_injected_solutions_using_labels` is true (see `fields`
2373
+ # comment).
2374
+ class ConstraintRelaxation
2375
+ include ::Google::Protobuf::MessageExts
2376
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2377
+
2378
+ # If `relaxations` is empty, the start time and sequence of all visits
2379
+ # on `routes` are fully constrained and no new visits may be inserted or
2380
+ # added to those routes. Also, a vehicle's start and end time in
2381
+ # `routes` is fully constrained, unless the vehicle is empty (i.e., has no
2382
+ # visits and has `used_if_route_is_empty` set to false in the model).
2383
+ #
2384
+ # `relaxations(i).level` specifies the constraint relaxation level applied
2385
+ # to a visit #j that satisfies:
2386
+ #
2387
+ # * `route.visits(j).start_time >= relaxations(i).threshold_time` AND
2388
+ # * `j + 1 >= relaxations(i).threshold_visit_count`
2389
+ #
2390
+ # Similarly, the vehicle start is relaxed to `relaxations(i).level` if it
2391
+ # satisfies:
2392
+ #
2393
+ # * `vehicle_start_time >= relaxations(i).threshold_time` AND
2394
+ # * `relaxations(i).threshold_visit_count == 0`
2395
+ # and the vehicle end is relaxed to `relaxations(i).level` if it satisfies:
2396
+ # * `vehicle_end_time >= relaxations(i).threshold_time` AND
2397
+ # * `route.visits_size() + 1 >= relaxations(i).threshold_visit_count`
2398
+ #
2399
+ # To apply a relaxation level if a visit meets the `threshold_visit_count`
2400
+ # OR the `threshold_time` add two `relaxations` with the same `level`:
2401
+ # one with only `threshold_visit_count` set and the other with only
2402
+ # `threshold_time` set. If a visit satisfies the conditions of multiple
2403
+ # `relaxations`, the most relaxed level applies. As a result, from the
2404
+ # vehicle start through the route visits in order to the vehicle end, the
2405
+ # relaxation level becomes more relaxed: i.e., the relaxation level is
2406
+ # non-decreasing as the route progresses.
2407
+ #
2408
+ # The timing and sequence of route visits that do not satisfy the
2409
+ # threshold conditions of any `relaxations` are fully constrained
2410
+ # and no visits may be inserted into these sequences. Also, if a
2411
+ # vehicle start or end does not satisfy the conditions of any
2412
+ # relaxation the time is fixed, unless the vehicle is empty.
2413
+ # @!attribute [rw] level
2414
+ # @return [::Google::Cloud::Optimization::V1::InjectedSolutionConstraint::ConstraintRelaxation::Relaxation::Level]
2415
+ # The constraint relaxation level that applies when the conditions
2416
+ # at or after `threshold_time` AND at least `threshold_visit_count` are
2417
+ # satified.
2418
+ # @!attribute [rw] threshold_time
2419
+ # @return [::Google::Protobuf::Timestamp]
2420
+ # The time at or after which the relaxation `level` may be applied.
2421
+ # @!attribute [rw] threshold_visit_count
2422
+ # @return [::Integer]
2423
+ # The number of visits at or after which the relaxation `level` may be
2424
+ # applied. If `threshold_visit_count` is 0 (or unset), the `level` may be
2425
+ # applied directly at the vehicle start.
2426
+ #
2427
+ # If it is `route.visits_size() + 1`, the `level` may only be applied to
2428
+ # the vehicle end. If it is more than `route.visits_size() + 1`,
2429
+ # `level` is not applied at all for that route.
2430
+ class Relaxation
2431
+ include ::Google::Protobuf::MessageExts
2432
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2433
+
2434
+ # Expresses the different constraint relaxation levels, which are
2435
+ # applied for a visit and those that follow when it satifies the
2436
+ # threshold conditions.
2437
+ #
2438
+ # The enumeration below is in order of increasing relaxation.
2439
+ module Level
2440
+ # Implicit default relaxation level: no constraints are relaxed,
2441
+ # i.e., all visits are fully constrained.
2442
+ #
2443
+ # This value must not be explicly used in `level`.
2444
+ LEVEL_UNSPECIFIED = 0
2445
+
2446
+ # Visit start times and vehicle start/end times will be relaxed, but
2447
+ # each visit remains bound to the same vehicle and the visit sequence
2448
+ # must be observed: no visit can be inserted between them or before
2449
+ # them.
2450
+ RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1
2451
+
2452
+ # Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence
2453
+ # is also relaxed: visits remain simply bound to their vehicle.
2454
+ RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2
2455
+
2456
+ # Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the
2457
+ # vehicle is also relaxed: visits are completely free at or after the
2458
+ # threshold time and can potentially become unperformed.
2459
+ RELAX_ALL_AFTER_THRESHOLD = 3
2460
+ end
2461
+ end
2462
+ end
2463
+ end
2464
+
2465
+ # Describes an error encountered when validating an `OptimizeToursRequest`.
2466
+ # @!attribute [rw] code
2467
+ # @return [::Integer]
2468
+ # A validation error is defined by the pair (`code`, `display_name`) which
2469
+ # are always present.
2470
+ #
2471
+ # Other fields (below) provide more context about the error.
2472
+ #
2473
+ # *MULTIPLE ERRORS*:
2474
+ # When there are multiple errors, the validation process tries to output
2475
+ # several of them. Much like a compiler, this is an imperfect process. Some
2476
+ # validation errors will be "fatal", meaning that they stop the entire
2477
+ # validation process. This is the case for `display_name="UNSPECIFIED"`
2478
+ # errors, among others. Some may cause the validation process to skip other
2479
+ # errors.
2480
+ #
2481
+ # *STABILITY*:
2482
+ # `code` and `display_name` should be very stable. But new codes and
2483
+ # display names may appear over time, which may cause a given (invalid)
2484
+ # request to yield a different (`code`, `display_name`) pair because the new
2485
+ # error hid the old one (see "MULTIPLE ERRORS").
2486
+ #
2487
+ # *REFERENCE*: A list of all (code, name) pairs:
2488
+ #
2489
+ # * UNSPECIFIED = 0;
2490
+ # * VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within
2491
+ # the deadline.
2492
+ #
2493
+ # * REQUEST_OPTIONS_ERROR = 12;
2494
+ # * REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
2495
+ # * REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
2496
+ # * REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
2497
+ # * REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
2498
+ # * REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
2499
+ # * REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE
2500
+ # = 1207;
2501
+ # * REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
2502
+ # * REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
2503
+ # * REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
2504
+ # * REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
2505
+ # * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
2506
+ # * REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
2507
+ # * REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
2508
+ # * REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
2509
+ # * INJECTED_SOLUTION_ERROR = 20;
2510
+ # * INJECTED_SOLUTION_MISSING_LABEL = 2000;
2511
+ # * INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
2512
+ # * INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
2513
+ # * SHIPMENT_MODEL_ERROR = 22;
2514
+ # * SHIPMENT_MODEL_TOO_LARGE = 2200;
2515
+ # * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
2516
+ # * SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
2517
+ # * SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
2518
+ # * SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
2519
+ # * SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
2520
+ # * INDEX_ERROR = 24;
2521
+ # * TAG_ERROR = 26;
2522
+ # * TIME_WINDOW_ERROR = 28;
2523
+ # * TIME_WINDOW_INVALID_START_TIME = 2800;
2524
+ # * TIME_WINDOW_INVALID_END_TIME = 2801;
2525
+ # * TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
2526
+ # * TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
2527
+ # * TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
2528
+ # * TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
2529
+ # * TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
2530
+ # * TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
2531
+ # * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME
2532
+ # = 2808;
2533
+ # * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
2534
+ # * TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME
2535
+ # = 2810;
2536
+ # * TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
2537
+ # * TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
2538
+ # * TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
2539
+ # * TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
2540
+ # * TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
2541
+ # * TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
2542
+ # * TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
2543
+ # = 2817;
2544
+ # * TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
2545
+ # * TRANSITION_ATTRIBUTES_ERROR = 30;
2546
+ # * TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
2547
+ # * TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
2548
+ # * TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
2549
+ # * TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
2550
+ # * TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
2551
+ # * TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
2552
+ # * TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
2553
+ # * TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
2554
+ # * TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
2555
+ # * TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
2556
+ # * AMOUNT_ERROR = 31;
2557
+ # * AMOUNT_NEGATIVE_VALUE = 3100;
2558
+ # * LOAD_LIMIT_ERROR = 33;
2559
+ # * LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
2560
+ # * LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
2561
+ # * LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
2562
+ # * LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
2563
+ # * LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
2564
+ # * LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
2565
+ # * LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
2566
+ # * INTERVAL_ERROR = 34;
2567
+ # * INTERVAL_MIN_EXCEEDS_MAX = 3401;
2568
+ # * INTERVAL_NEGATIVE_MIN = 3402;
2569
+ # * INTERVAL_NEGATIVE_MAX = 3403;
2570
+ # * INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
2571
+ # * INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
2572
+ # * DISTANCE_LIMIT_ERROR = 36;
2573
+ # * DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
2574
+ # * DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
2575
+ # * DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
2576
+ # * DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
2577
+ # * DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
2578
+ # * DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
2579
+ # * DURATION_LIMIT_ERROR = 38;
2580
+ # * DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
2581
+ # * DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
2582
+ # * DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
2583
+ # * DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
2584
+ # * DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
2585
+ # * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
2586
+ # * DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
2587
+ # * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR
2588
+ # = 3807;
2589
+ # * DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX
2590
+ # = 3808;
2591
+ # * DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
2592
+ # * DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
2593
+ # * DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
2594
+ # * DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE
2595
+ # = 3812;
2596
+ # * DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
2597
+ # * DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
2598
+ # * DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION
2599
+ # = 3815;
2600
+ # * SHIPMENT_ERROR = 40;
2601
+ # * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
2602
+ # * SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION
2603
+ # = 4001;
2604
+ # * SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
2605
+ # * SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
2606
+ # * SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
2607
+ # * SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
2608
+ # * SHIPMENT_INVALID_PENALTY_COST = 4006;
2609
+ # * SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
2610
+ # * SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
2611
+ # * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
2612
+ # * SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
2613
+ # * SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
2614
+ # * SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
2615
+ # * SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
2616
+ # * SHIPMENT_DETOUR_WITHOUT_PICKUP_AND_DELIVERY = 4014;
2617
+ # * VEHICLE_ERROR = 42;
2618
+ # * VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
2619
+ # * VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
2620
+ # * VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
2621
+ # * VEHICLE_EMPTY_START_TAG = 4203;
2622
+ # * VEHICLE_DUPLICATE_START_TAG = 4204;
2623
+ # * VEHICLE_EMPTY_END_TAG = 4205;
2624
+ # * VEHICLE_DUPLICATE_END_TAG = 4206;
2625
+ # * VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
2626
+ # * VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
2627
+ # * VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
2628
+ # * VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
2629
+ # * VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
2630
+ # * VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
2631
+ # * VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
2632
+ # * VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
2633
+ # * VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
2634
+ # * VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
2635
+ # * VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
2636
+ # * VEHICLE_INVALID_COST_PER_HOUR = 4218;
2637
+ # * VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
2638
+ # * VEHICLE_INVALID_FIXED_COST = 4220;
2639
+ # * VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
2640
+ # * VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
2641
+ # * VISIT_REQUEST_ERROR = 44;
2642
+ # * VISIT_REQUEST_EMPTY_TAG = 4400;
2643
+ # * VISIT_REQUEST_DUPLICATE_TAG = 4401;
2644
+ # * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
2645
+ # * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
2646
+ # * PRECEDENCE_ERROR = 46;
2647
+ # * BREAK_ERROR = 48;
2648
+ # * BREAK_RULE_EMPTY = 4800;
2649
+ # * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
2650
+ # * BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
2651
+ # * BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
2652
+ # * BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
2653
+ # * BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
2654
+ # * BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
2655
+ # * BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
2656
+ # * BREAK_REQUEST_NON_SCHEDULABLE = 4808;
2657
+ # * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
2658
+ # * BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
2659
+ # * BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
2660
+ # * BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION
2661
+ # = 4812;
2662
+ # * BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
2663
+ # * BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
2664
+ # * BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
2665
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
2666
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
2667
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
2668
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
2669
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
2670
+ # * SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
2671
+ # * SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
2672
+ # * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
2673
+ # * SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
2674
+ # * SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
2675
+ # * SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
2676
+ # * SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
2677
+ # * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
2678
+ # * SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
2679
+ # * SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
2680
+ # * SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
2681
+ # * SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
2682
+ # * SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
2683
+ # * VEHICLE_OPERATOR_ERROR = 54;
2684
+ # * VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
2685
+ # * VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
2686
+ # * VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
2687
+ # * VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
2688
+ # * VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
2689
+ # * DURATION_SECONDS_MATRIX_ERROR = 56;
2690
+ # * DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
2691
+ # * DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
2692
+ # * GRAPH_ARC_ERROR = 58;
2693
+ # * GRAPH_ARC_DURATION_NEGATIVE_OR_NAN = 5800;
2694
+ # * GRAPH_ARC_DURATION_EXCEEDS_GLOBAL_DURATION = 5801;
2695
+ # @!attribute [rw] display_name
2696
+ # @return [::String]
2697
+ # The error display name.
2698
+ # @!attribute [rw] fields
2699
+ # @return [::Array<::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference>]
2700
+ # An error context may involve 0, 1 (most of the time) or more fields. For
2701
+ # example, referring to vehicle #4 and shipment #2's first pickup can be
2702
+ # done as follows:
2703
+ # ```
2704
+ # fields { name: "vehicles" index: 4}
2705
+ # fields { name: "shipments" index: 2 sub_field \\{name: "pickups" index: 0} }
2706
+ # ```
2707
+ # Note, however, that the cardinality of `fields` should not change for a
2708
+ # given error code.
2709
+ # @!attribute [rw] error_message
2710
+ # @return [::String]
2711
+ # Human-readable string describing the error. There is a 1:1 mapping
2712
+ # between `code` and `error_message` (when code != "UNSPECIFIED").
2713
+ #
2714
+ # *STABILITY*: Not stable: the error message associated to a given `code` may
2715
+ # change (hopefully to clarify it) over time. Please rely on the
2716
+ # `display_name` and `code` instead.
2717
+ # @!attribute [rw] offending_values
2718
+ # @return [::String]
2719
+ # May contain the value(s) of the field(s). This is not always available. You
2720
+ # should absolutely not rely on it and use it only for manual model
2721
+ # debugging.
2722
+ class OptimizeToursValidationError
2723
+ include ::Google::Protobuf::MessageExts
2724
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2725
+
2726
+ # Specifies a context for the validation error. A `FieldReference` always
2727
+ # refers to a given field in this file and follows the same hierarchical
2728
+ # structure. For example, we may specify element #2 of `start_time_windows`
2729
+ # of vehicle #5 using:
2730
+ # ```
2731
+ # name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 }
2732
+ # ```
2733
+ # We however omit top-level entities such as `OptimizeToursRequest` or
2734
+ # `ShipmentModel` to avoid crowding the message.
2735
+ # @!attribute [rw] name
2736
+ # @return [::String]
2737
+ # Name of the field, e.g., "vehicles".
2738
+ # @!attribute [rw] index
2739
+ # @return [::Integer]
2740
+ # Index of the field if repeated.
2741
+ # @!attribute [rw] key
2742
+ # @return [::String]
2743
+ # Key if the field is a map.
2744
+ # @!attribute [rw] sub_field
2745
+ # @return [::Google::Cloud::Optimization::V1::OptimizeToursValidationError::FieldReference]
2746
+ # Recursively nested sub-field, if needed.
2747
+ class FieldReference
2748
+ include ::Google::Protobuf::MessageExts
2749
+ extend ::Google::Protobuf::MessageExts::ClassMethods
2750
+ end
2751
+ end
2752
+ end
2753
+ end
2754
+ end
2755
+ end