Skip to content

Commit 083c352

Browse files
feat: [optimization] added support for walking mode and cost_per_kilometer_below_soft_max (googleapis#4620)
* feat: added support for walking mode and cost_per_kilometer_below_soft_max Clients can now use walking as the travel mode. And clients can set a cost per kilometer bounded by the soft max. PiperOrigin-RevId: 563199524 Source-Link: googleapis/googleapis@7578999 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ba24bb374d50f1333eba36cf29988a054ba4ffff Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9wdGltaXphdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiYmEyNGJiMzc0ZDUwZjEzMzNlYmEzNmNmMjk5ODhhMDU0YmE0ZmZmZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 888a997 commit 083c352

8 files changed

Lines changed: 175 additions & 85 deletions

File tree

packages/google-cloud-optimization/protos/google/cloud/optimization/v1/async_model.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-optimization/protos/google/cloud/optimization/v1/fleet_routing.proto

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -122,12 +122,20 @@ message OptimizeToursRequest {
122122
VALIDATE_ONLY = 1;
123123

124124
// Only populates
125+
// [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors]
126+
// or
125127
// [OptimizeToursResponse.skipped_shipments][google.cloud.optimization.v1.OptimizeToursResponse.skipped_shipments],
126128
// and doesn't actually solve the rest of the request (`status` and `routes`
127129
// are unset in the response).
130+
// If infeasibilities in `injected_solution_constraint` routes are detected
131+
// they are populated in the
132+
// [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors]
133+
// field and
134+
// [OptimizeToursResponse.skipped_shipments][google.cloud.optimization.v1.OptimizeToursResponse.skipped_shipments]
135+
// is left empty.
128136
//
129137
// *IMPORTANT*: not all infeasible shipments are returned here, but only the
130-
// ones that are detected as infeasible as a preprocessing.
138+
// ones that are detected as infeasible during preprocessing.
131139
DETECT_SOME_INFEASIBLE_SHIPMENTS = 2;
132140
}
133141

@@ -165,15 +173,6 @@ message OptimizeToursRequest {
165173
// By default, the solving mode is `DEFAULT_SOLVE` (0).
166174
SolvingMode solving_mode = 4;
167175

168-
// Truncates the number of validation errors returned. These errors are
169-
// typically attached to an INVALID_ARGUMENT error payload as a BadRequest
170-
// error detail (https://cloud.google.com/apis/design/errors#error_details),
171-
// unless solving_mode=VALIDATE_ONLY: see the
172-
// [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors]
173-
// field.
174-
// This defaults to 100 and is capped at 10,000.
175-
optional int32 max_validation_errors = 5;
176-
177176
// Search mode used to solve the request.
178177
SearchMode search_mode = 6;
179178

@@ -339,6 +338,15 @@ message OptimizeToursRequest {
339338
// meters/seconds.
340339
optional double geodesic_meters_per_second = 16;
341340

341+
// Truncates the number of validation errors returned. These errors are
342+
// typically attached to an INVALID_ARGUMENT error payload as a BadRequest
343+
// error detail (https://cloud.google.com/apis/design/errors#error_details),
344+
// unless solving_mode=VALIDATE_ONLY: see the
345+
// [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors]
346+
// field.
347+
// This defaults to 100 and is capped at 10,000.
348+
optional int32 max_validation_errors = 5;
349+
342350
// Label that may be used to identify this request, reported back in the
343351
// [OptimizeToursResponse.request_label][google.cloud.optimization.v1.OptimizeToursResponse.request_label].
344352
string label = 17;
@@ -1131,6 +1139,9 @@ message Vehicle {
11311139

11321140
// Travel mode corresponding to driving directions (car, ...).
11331141
DRIVING = 1;
1142+
1143+
// Travel mode corresponding to walking directions.
1144+
WALKING = 2;
11341145
}
11351146

11361147
// Policy on how a vehicle can be unloaded. Applies only to shipments having
@@ -1565,6 +1576,15 @@ message DistanceLimit {
15651576
// nonnegative.
15661577
optional int64 soft_max_meters = 2;
15671578

1579+
// Cost per kilometer incurred, increasing up to `soft_max_meters`, with
1580+
// formula:
1581+
// ```
1582+
// min(distance_meters, soft_max_meters) / 1000.0 *
1583+
// cost_per_kilometer_below_soft_max.
1584+
// ```
1585+
// This cost is not supported in `route_distance_limit`.
1586+
optional double cost_per_kilometer_below_soft_max = 4;
1587+
15681588
// Cost per kilometer incurred if distance is above `soft_max_meters` limit.
15691589
// The additional cost is 0 if the distance is under the limit, otherwise the
15701590
// formula used to compute the cost is the following:
@@ -2395,7 +2415,8 @@ message InjectedSolutionConstraint {
23952415
RELAX_VISIT_TIMES_AFTER_THRESHOLD = 1;
23962416

23972417
// Same as `RELAX_VISIT_TIMES_AFTER_THRESHOLD`, but the visit sequence
2398-
// is also relaxed: visits remain simply bound to their vehicle.
2418+
// is also relaxed: visits can only be performed by this vehicle, but
2419+
// can potentially become unperformed.
23992420
RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD = 2;
24002421

24012422
// Same as `RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD`, but the
@@ -2533,6 +2554,7 @@ message OptimizeToursValidationError {
25332554
// * INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
25342555
// * INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
25352556
// * INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
2557+
// * INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
25362558
// * SHIPMENT_MODEL_ERROR = 22;
25372559
// * SHIPMENT_MODEL_TOO_LARGE = 2200;
25382560
// * SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;

packages/google-cloud-optimization/protos/protos.d.ts

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)