google-cloud-optimization-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,65 @@
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
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/optimization/v1/version"
24
+
25
+ require "google/cloud/optimization/v1/fleet_routing/credentials"
26
+ require "google/cloud/optimization/v1/fleet_routing/operations"
27
+ require "google/cloud/optimization/v1/fleet_routing/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Optimization
32
+ module V1
33
+ ##
34
+ # A service for optimizing vehicle tours.
35
+ #
36
+ # Validity of certain types of fields:
37
+ #
38
+ # * `google.protobuf.Timestamp`
39
+ # * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
40
+ # * seconds must be in [0, 253402300799],
41
+ # i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
42
+ # * nanos must be unset or set to 0.
43
+ # * `google.protobuf.Duration`
44
+ # * seconds must be in [0, 253402300799],
45
+ # i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
46
+ # * nanos must be unset or set to 0.
47
+ # * `google.type.LatLng`
48
+ # * latitude must be in [-90.0, 90.0].
49
+ # * longitude must be in [-180.0, 180.0].
50
+ # * at least one of latitude and longitude must be non-zero.
51
+ #
52
+ # To load this service and instantiate a client:
53
+ #
54
+ # require "google/cloud/optimization/v1/fleet_routing"
55
+ # client = ::Google::Cloud::Optimization::V1::FleetRouting::Client.new
56
+ #
57
+ module FleetRouting
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ helper_path = ::File.join __dir__, "fleet_routing", "helpers.rb"
65
+ require "google/cloud/optimization/v1/fleet_routing/helpers" if ::File.file? helper_path
@@ -0,0 +1,483 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/optimization/v1/fleet_routing.proto
3
+
4
+ require 'google/api/annotations_pb'
5
+ require 'google/api/client_pb'
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/cloud/optimization/v1/async_model_pb'
8
+ require 'google/longrunning/operations_pb'
9
+ require 'google/protobuf/duration_pb'
10
+ require 'google/protobuf/timestamp_pb'
11
+ require 'google/type/latlng_pb'
12
+ require 'google/protobuf'
13
+
14
+ Google::Protobuf::DescriptorPool.generated_pool.build do
15
+ add_file("google/cloud/optimization/v1/fleet_routing.proto", :syntax => :proto3) do
16
+ add_message "google.cloud.optimization.v1.OptimizeToursRequest" do
17
+ optional :parent, :string, 1
18
+ optional :timeout, :message, 2, "google.protobuf.Duration"
19
+ optional :model, :message, 3, "google.cloud.optimization.v1.ShipmentModel"
20
+ optional :solving_mode, :enum, 4, "google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode"
21
+ proto3_optional :max_validation_errors, :int32, 5
22
+ optional :search_mode, :enum, 6, "google.cloud.optimization.v1.OptimizeToursRequest.SearchMode"
23
+ repeated :injected_first_solution_routes, :message, 7, "google.cloud.optimization.v1.ShipmentRoute"
24
+ optional :injected_solution_constraint, :message, 8, "google.cloud.optimization.v1.InjectedSolutionConstraint"
25
+ repeated :refresh_details_routes, :message, 9, "google.cloud.optimization.v1.ShipmentRoute"
26
+ optional :interpret_injected_solutions_using_labels, :bool, 10
27
+ optional :consider_road_traffic, :bool, 11
28
+ optional :populate_polylines, :bool, 12
29
+ optional :populate_transition_polylines, :bool, 13
30
+ optional :allow_large_deadline_despite_interruption_risk, :bool, 14
31
+ optional :use_geodesic_distances, :bool, 15
32
+ proto3_optional :geodesic_meters_per_second, :double, 16
33
+ optional :label, :string, 17
34
+ optional :populate_travel_step_polylines, :bool, 20
35
+ end
36
+ add_enum "google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode" do
37
+ value :DEFAULT_SOLVE, 0
38
+ value :VALIDATE_ONLY, 1
39
+ value :DETECT_SOME_INFEASIBLE_SHIPMENTS, 2
40
+ end
41
+ add_enum "google.cloud.optimization.v1.OptimizeToursRequest.SearchMode" do
42
+ value :SEARCH_MODE_UNSPECIFIED, 0
43
+ value :RETURN_FAST, 1
44
+ value :CONSUME_ALL_AVAILABLE_TIME, 2
45
+ end
46
+ add_message "google.cloud.optimization.v1.OptimizeToursResponse" do
47
+ repeated :routes, :message, 1, "google.cloud.optimization.v1.ShipmentRoute"
48
+ optional :request_label, :string, 3
49
+ repeated :skipped_shipments, :message, 4, "google.cloud.optimization.v1.SkippedShipment"
50
+ repeated :validation_errors, :message, 5, "google.cloud.optimization.v1.OptimizeToursValidationError"
51
+ optional :metrics, :message, 6, "google.cloud.optimization.v1.OptimizeToursResponse.Metrics"
52
+ optional :total_cost, :double, 2
53
+ end
54
+ add_message "google.cloud.optimization.v1.OptimizeToursResponse.Metrics" do
55
+ optional :aggregated_route_metrics, :message, 1, "google.cloud.optimization.v1.AggregatedMetrics"
56
+ optional :skipped_mandatory_shipment_count, :int32, 2
57
+ optional :used_vehicle_count, :int32, 3
58
+ optional :earliest_vehicle_start_time, :message, 4, "google.protobuf.Timestamp"
59
+ optional :latest_vehicle_end_time, :message, 5, "google.protobuf.Timestamp"
60
+ map :costs, :string, :double, 10
61
+ optional :total_cost, :double, 6
62
+ end
63
+ add_message "google.cloud.optimization.v1.BatchOptimizeToursRequest" do
64
+ optional :parent, :string, 1
65
+ repeated :model_configs, :message, 2, "google.cloud.optimization.v1.BatchOptimizeToursRequest.AsyncModelConfig"
66
+ end
67
+ add_message "google.cloud.optimization.v1.BatchOptimizeToursRequest.AsyncModelConfig" do
68
+ optional :display_name, :string, 1
69
+ optional :input_config, :message, 2, "google.cloud.optimization.v1.InputConfig"
70
+ optional :output_config, :message, 3, "google.cloud.optimization.v1.OutputConfig"
71
+ optional :enable_checkpoints, :bool, 4
72
+ end
73
+ add_message "google.cloud.optimization.v1.BatchOptimizeToursResponse" do
74
+ end
75
+ add_message "google.cloud.optimization.v1.ShipmentModel" do
76
+ repeated :shipments, :message, 1, "google.cloud.optimization.v1.Shipment"
77
+ repeated :vehicles, :message, 2, "google.cloud.optimization.v1.Vehicle"
78
+ proto3_optional :max_active_vehicles, :int32, 4
79
+ optional :global_start_time, :message, 5, "google.protobuf.Timestamp"
80
+ optional :global_end_time, :message, 6, "google.protobuf.Timestamp"
81
+ optional :global_duration_cost_per_hour, :double, 7
82
+ repeated :duration_distance_matrices, :message, 8, "google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix"
83
+ repeated :duration_distance_matrix_src_tags, :string, 9
84
+ repeated :duration_distance_matrix_dst_tags, :string, 10
85
+ repeated :transition_attributes, :message, 11, "google.cloud.optimization.v1.TransitionAttributes"
86
+ repeated :shipment_type_incompatibilities, :message, 12, "google.cloud.optimization.v1.ShipmentTypeIncompatibility"
87
+ repeated :shipment_type_requirements, :message, 13, "google.cloud.optimization.v1.ShipmentTypeRequirement"
88
+ repeated :precedence_rules, :message, 14, "google.cloud.optimization.v1.ShipmentModel.PrecedenceRule"
89
+ repeated :break_rules, :message, 15, "google.cloud.optimization.v1.ShipmentModel.BreakRule"
90
+ end
91
+ add_message "google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix" do
92
+ repeated :rows, :message, 1, "google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix.Row"
93
+ optional :vehicle_start_tag, :string, 2
94
+ end
95
+ add_message "google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix.Row" do
96
+ repeated :durations, :message, 1, "google.protobuf.Duration"
97
+ repeated :meters, :double, 2
98
+ end
99
+ add_message "google.cloud.optimization.v1.ShipmentModel.PrecedenceRule" do
100
+ proto3_optional :first_index, :int32, 1
101
+ optional :first_is_delivery, :bool, 3
102
+ proto3_optional :second_index, :int32, 2
103
+ optional :second_is_delivery, :bool, 4
104
+ optional :offset_duration, :message, 5, "google.protobuf.Duration"
105
+ end
106
+ add_message "google.cloud.optimization.v1.ShipmentModel.BreakRule" do
107
+ repeated :break_requests, :message, 1, "google.cloud.optimization.v1.ShipmentModel.BreakRule.BreakRequest"
108
+ repeated :frequency_constraints, :message, 2, "google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint"
109
+ end
110
+ add_message "google.cloud.optimization.v1.ShipmentModel.BreakRule.BreakRequest" do
111
+ optional :earliest_start_time, :message, 1, "google.protobuf.Timestamp"
112
+ optional :latest_start_time, :message, 2, "google.protobuf.Timestamp"
113
+ optional :min_duration, :message, 3, "google.protobuf.Duration"
114
+ end
115
+ add_message "google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint" do
116
+ optional :min_break_duration, :message, 1, "google.protobuf.Duration"
117
+ optional :max_inter_break_duration, :message, 2, "google.protobuf.Duration"
118
+ end
119
+ add_message "google.cloud.optimization.v1.Shipment" do
120
+ repeated :pickups, :message, 1, "google.cloud.optimization.v1.Shipment.VisitRequest"
121
+ repeated :deliveries, :message, 2, "google.cloud.optimization.v1.Shipment.VisitRequest"
122
+ map :load_demands, :string, :message, 14, "google.cloud.optimization.v1.Shipment.Load"
123
+ proto3_optional :penalty_cost, :double, 4
124
+ repeated :allowed_vehicle_indices, :int32, 5
125
+ repeated :costs_per_vehicle, :double, 6
126
+ repeated :costs_per_vehicle_indices, :int32, 7
127
+ proto3_optional :pickup_to_delivery_relative_detour_limit, :double, 8
128
+ optional :pickup_to_delivery_absolute_detour_limit, :message, 9, "google.protobuf.Duration"
129
+ optional :pickup_to_delivery_time_limit, :message, 10, "google.protobuf.Duration"
130
+ optional :shipment_type, :string, 11
131
+ optional :label, :string, 12
132
+ optional :ignore, :bool, 13
133
+ repeated :demands, :message, 3, "google.cloud.optimization.v1.CapacityQuantity"
134
+ end
135
+ add_message "google.cloud.optimization.v1.Shipment.VisitRequest" do
136
+ optional :arrival_location, :message, 1, "google.type.LatLng"
137
+ optional :arrival_waypoint, :message, 2, "google.cloud.optimization.v1.Waypoint"
138
+ optional :departure_location, :message, 3, "google.type.LatLng"
139
+ optional :departure_waypoint, :message, 4, "google.cloud.optimization.v1.Waypoint"
140
+ repeated :tags, :string, 5
141
+ repeated :time_windows, :message, 6, "google.cloud.optimization.v1.TimeWindow"
142
+ optional :duration, :message, 7, "google.protobuf.Duration"
143
+ optional :cost, :double, 8
144
+ map :load_demands, :string, :message, 12, "google.cloud.optimization.v1.Shipment.Load"
145
+ repeated :visit_types, :string, 10
146
+ optional :label, :string, 11
147
+ repeated :demands, :message, 9, "google.cloud.optimization.v1.CapacityQuantity"
148
+ end
149
+ add_message "google.cloud.optimization.v1.Shipment.Load" do
150
+ optional :amount, :int64, 2
151
+ end
152
+ add_message "google.cloud.optimization.v1.ShipmentTypeIncompatibility" do
153
+ repeated :types, :string, 1
154
+ optional :incompatibility_mode, :enum, 2, "google.cloud.optimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode"
155
+ end
156
+ add_enum "google.cloud.optimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode" do
157
+ value :INCOMPATIBILITY_MODE_UNSPECIFIED, 0
158
+ value :NOT_PERFORMED_BY_SAME_VEHICLE, 1
159
+ value :NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY, 2
160
+ end
161
+ add_message "google.cloud.optimization.v1.ShipmentTypeRequirement" do
162
+ repeated :required_shipment_type_alternatives, :string, 1
163
+ repeated :dependent_shipment_types, :string, 2
164
+ optional :requirement_mode, :enum, 3, "google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode"
165
+ end
166
+ add_enum "google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode" do
167
+ value :REQUIREMENT_MODE_UNSPECIFIED, 0
168
+ value :PERFORMED_BY_SAME_VEHICLE, 1
169
+ value :IN_SAME_VEHICLE_AT_PICKUP_TIME, 2
170
+ value :IN_SAME_VEHICLE_AT_DELIVERY_TIME, 3
171
+ end
172
+ add_message "google.cloud.optimization.v1.Vehicle" do
173
+ optional :travel_mode, :enum, 1, "google.cloud.optimization.v1.Vehicle.TravelMode"
174
+ optional :start_location, :message, 3, "google.type.LatLng"
175
+ optional :start_waypoint, :message, 4, "google.cloud.optimization.v1.Waypoint"
176
+ optional :end_location, :message, 5, "google.type.LatLng"
177
+ optional :end_waypoint, :message, 6, "google.cloud.optimization.v1.Waypoint"
178
+ repeated :start_tags, :string, 7
179
+ repeated :end_tags, :string, 8
180
+ repeated :start_time_windows, :message, 9, "google.cloud.optimization.v1.TimeWindow"
181
+ repeated :end_time_windows, :message, 10, "google.cloud.optimization.v1.TimeWindow"
182
+ proto3_optional :travel_duration_multiple, :double, 11
183
+ optional :unloading_policy, :enum, 12, "google.cloud.optimization.v1.Vehicle.UnloadingPolicy"
184
+ map :load_limits, :string, :message, 30, "google.cloud.optimization.v1.Vehicle.LoadLimit"
185
+ optional :cost_per_hour, :double, 16
186
+ optional :cost_per_traveled_hour, :double, 17
187
+ optional :cost_per_kilometer, :double, 18
188
+ optional :fixed_cost, :double, 19
189
+ optional :used_if_route_is_empty, :bool, 20
190
+ optional :route_duration_limit, :message, 21, "google.cloud.optimization.v1.Vehicle.DurationLimit"
191
+ optional :travel_duration_limit, :message, 22, "google.cloud.optimization.v1.Vehicle.DurationLimit"
192
+ optional :route_distance_limit, :message, 23, "google.cloud.optimization.v1.DistanceLimit"
193
+ map :extra_visit_duration_for_visit_type, :string, :message, 24, "google.protobuf.Duration"
194
+ optional :break_rule, :message, 25, "google.cloud.optimization.v1.BreakRule"
195
+ optional :label, :string, 27
196
+ optional :ignore, :bool, 28
197
+ repeated :break_rule_indices, :int32, 29
198
+ repeated :capacities, :message, 13, "google.cloud.optimization.v1.CapacityQuantity"
199
+ repeated :start_load_intervals, :message, 14, "google.cloud.optimization.v1.CapacityQuantityInterval"
200
+ repeated :end_load_intervals, :message, 15, "google.cloud.optimization.v1.CapacityQuantityInterval"
201
+ end
202
+ add_message "google.cloud.optimization.v1.Vehicle.LoadLimit" do
203
+ proto3_optional :max_load, :int64, 1
204
+ optional :soft_max_load, :int64, 2
205
+ optional :cost_per_unit_above_soft_max, :double, 3
206
+ optional :start_load_interval, :message, 4, "google.cloud.optimization.v1.Vehicle.LoadLimit.Interval"
207
+ optional :end_load_interval, :message, 5, "google.cloud.optimization.v1.Vehicle.LoadLimit.Interval"
208
+ end
209
+ add_message "google.cloud.optimization.v1.Vehicle.LoadLimit.Interval" do
210
+ optional :min, :int64, 1
211
+ proto3_optional :max, :int64, 2
212
+ end
213
+ add_message "google.cloud.optimization.v1.Vehicle.DurationLimit" do
214
+ optional :max_duration, :message, 1, "google.protobuf.Duration"
215
+ optional :soft_max_duration, :message, 2, "google.protobuf.Duration"
216
+ proto3_optional :cost_per_hour_after_soft_max, :double, 3
217
+ optional :quadratic_soft_max_duration, :message, 4, "google.protobuf.Duration"
218
+ proto3_optional :cost_per_square_hour_after_quadratic_soft_max, :double, 5
219
+ end
220
+ add_enum "google.cloud.optimization.v1.Vehicle.TravelMode" do
221
+ value :TRAVEL_MODE_UNSPECIFIED, 0
222
+ value :DRIVING, 1
223
+ end
224
+ add_enum "google.cloud.optimization.v1.Vehicle.UnloadingPolicy" do
225
+ value :UNLOADING_POLICY_UNSPECIFIED, 0
226
+ value :LAST_IN_FIRST_OUT, 1
227
+ value :FIRST_IN_FIRST_OUT, 2
228
+ end
229
+ add_message "google.cloud.optimization.v1.TimeWindow" do
230
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
231
+ optional :end_time, :message, 2, "google.protobuf.Timestamp"
232
+ optional :soft_start_time, :message, 3, "google.protobuf.Timestamp"
233
+ optional :soft_end_time, :message, 4, "google.protobuf.Timestamp"
234
+ proto3_optional :cost_per_hour_before_soft_start_time, :double, 5
235
+ proto3_optional :cost_per_hour_after_soft_end_time, :double, 6
236
+ end
237
+ add_message "google.cloud.optimization.v1.CapacityQuantity" do
238
+ optional :type, :string, 1
239
+ optional :value, :int64, 2
240
+ end
241
+ add_message "google.cloud.optimization.v1.CapacityQuantityInterval" do
242
+ optional :type, :string, 1
243
+ proto3_optional :min_value, :int64, 2
244
+ proto3_optional :max_value, :int64, 3
245
+ end
246
+ add_message "google.cloud.optimization.v1.DistanceLimit" do
247
+ proto3_optional :max_meters, :int64, 1
248
+ proto3_optional :soft_max_meters, :int64, 2
249
+ proto3_optional :cost_per_kilometer_above_soft_max, :double, 3
250
+ end
251
+ add_message "google.cloud.optimization.v1.TransitionAttributes" do
252
+ optional :src_tag, :string, 1
253
+ optional :excluded_src_tag, :string, 2
254
+ optional :dst_tag, :string, 3
255
+ optional :excluded_dst_tag, :string, 4
256
+ optional :cost, :double, 5
257
+ optional :cost_per_kilometer, :double, 6
258
+ optional :distance_limit, :message, 7, "google.cloud.optimization.v1.DistanceLimit"
259
+ optional :delay, :message, 8, "google.protobuf.Duration"
260
+ end
261
+ add_message "google.cloud.optimization.v1.Waypoint" do
262
+ optional :side_of_road, :bool, 3
263
+ oneof :location_type do
264
+ optional :location, :message, 1, "google.cloud.optimization.v1.Location"
265
+ optional :place_id, :string, 2
266
+ end
267
+ end
268
+ add_message "google.cloud.optimization.v1.Location" do
269
+ optional :lat_lng, :message, 1, "google.type.LatLng"
270
+ proto3_optional :heading, :int32, 2
271
+ end
272
+ add_message "google.cloud.optimization.v1.BreakRule" do
273
+ repeated :break_requests, :message, 1, "google.cloud.optimization.v1.BreakRule.BreakRequest"
274
+ repeated :frequency_constraints, :message, 2, "google.cloud.optimization.v1.BreakRule.FrequencyConstraint"
275
+ end
276
+ add_message "google.cloud.optimization.v1.BreakRule.BreakRequest" do
277
+ optional :earliest_start_time, :message, 1, "google.protobuf.Timestamp"
278
+ optional :latest_start_time, :message, 2, "google.protobuf.Timestamp"
279
+ optional :min_duration, :message, 3, "google.protobuf.Duration"
280
+ end
281
+ add_message "google.cloud.optimization.v1.BreakRule.FrequencyConstraint" do
282
+ optional :min_break_duration, :message, 1, "google.protobuf.Duration"
283
+ optional :max_inter_break_duration, :message, 2, "google.protobuf.Duration"
284
+ end
285
+ add_message "google.cloud.optimization.v1.ShipmentRoute" do
286
+ optional :vehicle_index, :int32, 1
287
+ optional :vehicle_label, :string, 2
288
+ optional :vehicle_start_time, :message, 5, "google.protobuf.Timestamp"
289
+ optional :vehicle_end_time, :message, 6, "google.protobuf.Timestamp"
290
+ repeated :visits, :message, 7, "google.cloud.optimization.v1.ShipmentRoute.Visit"
291
+ repeated :transitions, :message, 8, "google.cloud.optimization.v1.ShipmentRoute.Transition"
292
+ optional :has_traffic_infeasibilities, :bool, 9
293
+ optional :route_polyline, :message, 10, "google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline"
294
+ repeated :breaks, :message, 11, "google.cloud.optimization.v1.ShipmentRoute.Break"
295
+ optional :metrics, :message, 12, "google.cloud.optimization.v1.AggregatedMetrics"
296
+ map :route_costs, :string, :double, 17
297
+ optional :route_total_cost, :double, 18
298
+ repeated :end_loads, :message, 13, "google.cloud.optimization.v1.CapacityQuantity"
299
+ repeated :travel_steps, :message, 14, "google.cloud.optimization.v1.ShipmentRoute.TravelStep"
300
+ optional :vehicle_detour, :message, 15, "google.protobuf.Duration"
301
+ optional :delay_before_vehicle_end, :message, 16, "google.cloud.optimization.v1.ShipmentRoute.Delay"
302
+ end
303
+ add_message "google.cloud.optimization.v1.ShipmentRoute.Delay" do
304
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
305
+ optional :duration, :message, 2, "google.protobuf.Duration"
306
+ end
307
+ add_message "google.cloud.optimization.v1.ShipmentRoute.Visit" do
308
+ optional :shipment_index, :int32, 1
309
+ optional :is_pickup, :bool, 2
310
+ optional :visit_request_index, :int32, 3
311
+ optional :start_time, :message, 4, "google.protobuf.Timestamp"
312
+ map :load_demands, :string, :message, 11, "google.cloud.optimization.v1.Shipment.Load"
313
+ optional :detour, :message, 6, "google.protobuf.Duration"
314
+ optional :shipment_label, :string, 7
315
+ optional :visit_label, :string, 8
316
+ repeated :arrival_loads, :message, 9, "google.cloud.optimization.v1.CapacityQuantity"
317
+ optional :delay_before_start, :message, 10, "google.cloud.optimization.v1.ShipmentRoute.Delay"
318
+ repeated :demands, :message, 5, "google.cloud.optimization.v1.CapacityQuantity"
319
+ end
320
+ add_message "google.cloud.optimization.v1.ShipmentRoute.Transition" do
321
+ optional :travel_duration, :message, 1, "google.protobuf.Duration"
322
+ optional :travel_distance_meters, :double, 2
323
+ optional :traffic_info_unavailable, :bool, 3
324
+ optional :delay_duration, :message, 4, "google.protobuf.Duration"
325
+ optional :break_duration, :message, 5, "google.protobuf.Duration"
326
+ optional :wait_duration, :message, 6, "google.protobuf.Duration"
327
+ optional :total_duration, :message, 7, "google.protobuf.Duration"
328
+ optional :start_time, :message, 8, "google.protobuf.Timestamp"
329
+ optional :route_polyline, :message, 9, "google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline"
330
+ map :vehicle_loads, :string, :message, 11, "google.cloud.optimization.v1.ShipmentRoute.VehicleLoad"
331
+ repeated :loads, :message, 10, "google.cloud.optimization.v1.CapacityQuantity"
332
+ end
333
+ add_message "google.cloud.optimization.v1.ShipmentRoute.VehicleLoad" do
334
+ optional :amount, :int64, 1
335
+ end
336
+ add_message "google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline" do
337
+ optional :points, :string, 1
338
+ end
339
+ add_message "google.cloud.optimization.v1.ShipmentRoute.Break" do
340
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
341
+ optional :duration, :message, 2, "google.protobuf.Duration"
342
+ end
343
+ add_message "google.cloud.optimization.v1.ShipmentRoute.TravelStep" do
344
+ optional :duration, :message, 1, "google.protobuf.Duration"
345
+ optional :distance_meters, :double, 2
346
+ optional :traffic_info_unavailable, :bool, 3
347
+ optional :route_polyline, :message, 4, "google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline"
348
+ end
349
+ add_message "google.cloud.optimization.v1.SkippedShipment" do
350
+ optional :index, :int32, 1
351
+ optional :label, :string, 2
352
+ repeated :reasons, :message, 3, "google.cloud.optimization.v1.SkippedShipment.Reason"
353
+ end
354
+ add_message "google.cloud.optimization.v1.SkippedShipment.Reason" do
355
+ optional :code, :enum, 1, "google.cloud.optimization.v1.SkippedShipment.Reason.Code"
356
+ proto3_optional :example_vehicle_index, :int32, 2
357
+ optional :example_exceeded_capacity_type, :string, 3
358
+ end
359
+ add_enum "google.cloud.optimization.v1.SkippedShipment.Reason.Code" do
360
+ value :CODE_UNSPECIFIED, 0
361
+ value :NO_VEHICLE, 1
362
+ value :DEMAND_EXCEEDS_VEHICLE_CAPACITY, 2
363
+ value :CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT, 3
364
+ value :CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT, 4
365
+ value :CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT, 5
366
+ value :CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS, 6
367
+ value :VEHICLE_NOT_ALLOWED, 7
368
+ end
369
+ add_message "google.cloud.optimization.v1.AggregatedMetrics" do
370
+ optional :performed_shipment_count, :int32, 1
371
+ optional :travel_duration, :message, 2, "google.protobuf.Duration"
372
+ optional :wait_duration, :message, 3, "google.protobuf.Duration"
373
+ optional :delay_duration, :message, 4, "google.protobuf.Duration"
374
+ optional :break_duration, :message, 5, "google.protobuf.Duration"
375
+ optional :visit_duration, :message, 6, "google.protobuf.Duration"
376
+ optional :total_duration, :message, 7, "google.protobuf.Duration"
377
+ optional :travel_distance_meters, :double, 8
378
+ map :max_loads, :string, :message, 9, "google.cloud.optimization.v1.ShipmentRoute.VehicleLoad"
379
+ map :costs, :string, :double, 10
380
+ optional :total_cost, :double, 11
381
+ end
382
+ add_message "google.cloud.optimization.v1.InjectedSolutionConstraint" do
383
+ repeated :routes, :message, 1, "google.cloud.optimization.v1.ShipmentRoute"
384
+ repeated :skipped_shipments, :message, 2, "google.cloud.optimization.v1.SkippedShipment"
385
+ repeated :constraint_relaxations, :message, 3, "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation"
386
+ end
387
+ add_message "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation" do
388
+ repeated :relaxations, :message, 1, "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation"
389
+ repeated :vehicle_indices, :int32, 2
390
+ end
391
+ add_message "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation" do
392
+ optional :level, :enum, 1, "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level"
393
+ optional :threshold_time, :message, 2, "google.protobuf.Timestamp"
394
+ optional :threshold_visit_count, :int32, 3
395
+ end
396
+ add_enum "google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level" do
397
+ value :LEVEL_UNSPECIFIED, 0
398
+ value :RELAX_VISIT_TIMES_AFTER_THRESHOLD, 1
399
+ value :RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD, 2
400
+ value :RELAX_ALL_AFTER_THRESHOLD, 3
401
+ end
402
+ add_message "google.cloud.optimization.v1.OptimizeToursValidationError" do
403
+ optional :code, :int32, 1
404
+ optional :display_name, :string, 2
405
+ repeated :fields, :message, 3, "google.cloud.optimization.v1.OptimizeToursValidationError.FieldReference"
406
+ optional :error_message, :string, 4
407
+ optional :offending_values, :string, 5
408
+ end
409
+ add_message "google.cloud.optimization.v1.OptimizeToursValidationError.FieldReference" do
410
+ optional :name, :string, 1
411
+ optional :sub_field, :message, 3, "google.cloud.optimization.v1.OptimizeToursValidationError.FieldReference"
412
+ oneof :index_or_key do
413
+ optional :index, :int32, 2
414
+ optional :key, :string, 4
415
+ end
416
+ end
417
+ end
418
+ end
419
+
420
+ module Google
421
+ module Cloud
422
+ module Optimization
423
+ module V1
424
+ OptimizeToursRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursRequest").msgclass
425
+ OptimizeToursRequest::SolvingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode").enummodule
426
+ OptimizeToursRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursRequest.SearchMode").enummodule
427
+ OptimizeToursResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursResponse").msgclass
428
+ OptimizeToursResponse::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursResponse.Metrics").msgclass
429
+ BatchOptimizeToursRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BatchOptimizeToursRequest").msgclass
430
+ BatchOptimizeToursRequest::AsyncModelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BatchOptimizeToursRequest.AsyncModelConfig").msgclass
431
+ BatchOptimizeToursResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BatchOptimizeToursResponse").msgclass
432
+ ShipmentModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel").msgclass
433
+ ShipmentModel::DurationDistanceMatrix = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix").msgclass
434
+ ShipmentModel::DurationDistanceMatrix::Row = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.DurationDistanceMatrix.Row").msgclass
435
+ ShipmentModel::PrecedenceRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.PrecedenceRule").msgclass
436
+ ShipmentModel::BreakRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.BreakRule").msgclass
437
+ ShipmentModel::BreakRule::BreakRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.BreakRule.BreakRequest").msgclass
438
+ ShipmentModel::BreakRule::FrequencyConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint").msgclass
439
+ Shipment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Shipment").msgclass
440
+ Shipment::VisitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Shipment.VisitRequest").msgclass
441
+ Shipment::Load = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Shipment.Load").msgclass
442
+ ShipmentTypeIncompatibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentTypeIncompatibility").msgclass
443
+ ShipmentTypeIncompatibility::IncompatibilityMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentTypeIncompatibility.IncompatibilityMode").enummodule
444
+ ShipmentTypeRequirement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentTypeRequirement").msgclass
445
+ ShipmentTypeRequirement::RequirementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentTypeRequirement.RequirementMode").enummodule
446
+ Vehicle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle").msgclass
447
+ Vehicle::LoadLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle.LoadLimit").msgclass
448
+ Vehicle::LoadLimit::Interval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle.LoadLimit.Interval").msgclass
449
+ Vehicle::DurationLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle.DurationLimit").msgclass
450
+ Vehicle::TravelMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle.TravelMode").enummodule
451
+ Vehicle::UnloadingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Vehicle.UnloadingPolicy").enummodule
452
+ TimeWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.TimeWindow").msgclass
453
+ CapacityQuantity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.CapacityQuantity").msgclass
454
+ CapacityQuantityInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.CapacityQuantityInterval").msgclass
455
+ DistanceLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.DistanceLimit").msgclass
456
+ TransitionAttributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.TransitionAttributes").msgclass
457
+ Waypoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Waypoint").msgclass
458
+ Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.Location").msgclass
459
+ BreakRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BreakRule").msgclass
460
+ BreakRule::BreakRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BreakRule.BreakRequest").msgclass
461
+ BreakRule::FrequencyConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.BreakRule.FrequencyConstraint").msgclass
462
+ ShipmentRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute").msgclass
463
+ ShipmentRoute::Delay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.Delay").msgclass
464
+ ShipmentRoute::Visit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.Visit").msgclass
465
+ ShipmentRoute::Transition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.Transition").msgclass
466
+ ShipmentRoute::VehicleLoad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.VehicleLoad").msgclass
467
+ ShipmentRoute::EncodedPolyline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.EncodedPolyline").msgclass
468
+ ShipmentRoute::Break = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.Break").msgclass
469
+ ShipmentRoute::TravelStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.ShipmentRoute.TravelStep").msgclass
470
+ SkippedShipment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.SkippedShipment").msgclass
471
+ SkippedShipment::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.SkippedShipment.Reason").msgclass
472
+ SkippedShipment::Reason::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.SkippedShipment.Reason.Code").enummodule
473
+ AggregatedMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.AggregatedMetrics").msgclass
474
+ InjectedSolutionConstraint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.InjectedSolutionConstraint").msgclass
475
+ InjectedSolutionConstraint::ConstraintRelaxation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation").msgclass
476
+ InjectedSolutionConstraint::ConstraintRelaxation::Relaxation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation").msgclass
477
+ InjectedSolutionConstraint::ConstraintRelaxation::Relaxation::Level = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level").enummodule
478
+ OptimizeToursValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursValidationError").msgclass
479
+ OptimizeToursValidationError::FieldReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.optimization.v1.OptimizeToursValidationError.FieldReference").msgclass
480
+ end
481
+ end
482
+ end
483
+ end
@@ -0,0 +1,85 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/optimization/v1/fleet_routing.proto for package 'google.cloud.optimization.v1'
3
+ # Original file comments:
4
+ # Copyright 2022 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/optimization/v1/fleet_routing_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Optimization
25
+ module V1
26
+ module FleetRouting
27
+ # A service for optimizing vehicle tours.
28
+ #
29
+ # Validity of certain types of fields:
30
+ #
31
+ # * `google.protobuf.Timestamp`
32
+ # * Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
33
+ # * seconds must be in [0, 253402300799],
34
+ # i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
35
+ # * nanos must be unset or set to 0.
36
+ # * `google.protobuf.Duration`
37
+ # * seconds must be in [0, 253402300799],
38
+ # i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
39
+ # * nanos must be unset or set to 0.
40
+ # * `google.type.LatLng`
41
+ # * latitude must be in [-90.0, 90.0].
42
+ # * longitude must be in [-180.0, 180.0].
43
+ # * at least one of latitude and longitude must be non-zero.
44
+ class Service
45
+
46
+ include ::GRPC::GenericService
47
+
48
+ self.marshal_class_method = :encode
49
+ self.unmarshal_class_method = :decode
50
+ self.service_name = 'google.cloud.optimization.v1.FleetRouting'
51
+
52
+ # Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
53
+ # `OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
54
+ # routes to be performed by vehicles minimizing the overall cost.
55
+ #
56
+ # A `ShipmentModel` model consists mainly of `Shipment`s that need to be
57
+ # carried out and `Vehicle`s that can be used to transport the `Shipment`s.
58
+ # The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
59
+ # they assign a series of `Visit`s to each vehicle, where a `Visit`
60
+ # corresponds to a `VisitRequest`, which is a pickup or delivery for a
61
+ # `Shipment`.
62
+ #
63
+ # The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
64
+ # minimizes the total cost where cost has many components defined in the
65
+ # `ShipmentModel`.
66
+ rpc :OptimizeTours, ::Google::Cloud::Optimization::V1::OptimizeToursRequest, ::Google::Cloud::Optimization::V1::OptimizeToursResponse
67
+ # Optimizes vehicle tours for one or more `OptimizeToursRequest`
68
+ # messages as a batch.
69
+ #
70
+ # This method is a Long Running Operation (LRO). The inputs for optimization
71
+ # (`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
72
+ # messages) are read/written from/to Cloud Storage in user-specified
73
+ # format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
74
+ # contains a `ShipmentModel` and returns an `OptimizeToursResponse`
75
+ # containing `ShipmentRoute`s, which are a set of routes to be performed by
76
+ # vehicles minimizing the overall cost.
77
+ rpc :BatchOptimizeTours, ::Google::Cloud::Optimization::V1::BatchOptimizeToursRequest, ::Google::Longrunning::Operation
78
+ end
79
+
80
+ Stub = Service.rpc_stub_class
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end