Skip to content

Commit d1ed9b8

Browse files
Google APIscopybara-github
authored andcommitted
feat: added the route modifiers
Users can now set optional conditions when calculating vehicle routes. PiperOrigin-RevId: 572934958
1 parent 3a90bf9 commit d1ed9b8

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

google/cloud/optimization/v1/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ php_gapic_library(
220220
rest_numeric_enums = True,
221221
service_yaml = "cloudoptimization_v1.yaml",
222222
transport = "grpc+rest",
223-
deps = [":optimization_php_proto"],
223+
deps = [
224+
":optimization_php_proto",
225+
],
224226
)
225227

226228
# Open Source Packages
@@ -328,6 +330,7 @@ load(
328330

329331
csharp_proto_library(
330332
name = "optimization_csharp_proto",
333+
extra_opts = [],
331334
deps = [":optimization_proto"],
332335
)
333336

google/cloud/optimization/v1/fleet_routing.proto

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,32 @@ message ShipmentTypeRequirement {
11241124
RequirementMode requirement_mode = 3;
11251125
}
11261126

1127+
// Encapsulates a set of optional conditions to satisfy when calculating
1128+
// vehicle routes. This is similar to `RouteModifiers` in the Google Maps
1129+
// Platform API; see:
1130+
// https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.
1131+
message RouteModifiers {
1132+
// Specifies whether to avoid toll roads where reasonable. Preference will be
1133+
// given to routes not containing toll roads. Applies only to motorized travel
1134+
// modes.
1135+
bool avoid_tolls = 2;
1136+
1137+
// Specifies whether to avoid highways where reasonable. Preference will be
1138+
// given to routes not containing highways. Applies only to motorized travel
1139+
// modes.
1140+
bool avoid_highways = 3;
1141+
1142+
// Specifies whether to avoid ferries where reasonable. Preference will be
1143+
// given to routes not containing travel by ferries. Applies only to motorized
1144+
// travel modes.
1145+
bool avoid_ferries = 4;
1146+
1147+
// Optional. Specifies whether to avoid navigating indoors where reasonable.
1148+
// Preference will be given to routes not containing indoor navigation.
1149+
// Applies only to the `WALKING` travel mode.
1150+
bool avoid_indoor = 5 [(google.api.field_behavior) = OPTIONAL];
1151+
}
1152+
11271153
// Models a vehicle in a shipment problem. Solving a shipment problem will
11281154
// build a route starting from `start_location` and ending at `end_location`
11291155
// for this vehicle. A route is a sequence of visits (see `ShipmentRoute`).
@@ -1264,6 +1290,10 @@ message Vehicle {
12641290
// speed. See also `travel_duration_multiple`.
12651291
TravelMode travel_mode = 1;
12661292

1293+
// Optional. A set of conditions to satisfy that affect the way routes are
1294+
// calculated for the given vehicle.
1295+
RouteModifiers route_modifiers = 2 [(google.api.field_behavior) = OPTIONAL];
1296+
12671297
// Geographic location where the vehicle starts before picking up any
12681298
// shipments. If not specified, the vehicle starts at its first pickup.
12691299
// If the shipment model has duration and distance matrices, `start_location`
@@ -2696,6 +2726,13 @@ message OptimizeToursValidationError {
26962726
// * VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
26972727
// * VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
26982728
// * PRECEDENCE_ERROR = 46;
2729+
// * PRECEDENCE_RULE_MISSING_FIRST_INDEX = 4600;
2730+
// * PRECEDENCE_RULE_MISSING_SECOND_INDEX = 4601;
2731+
// * PRECEDENCE_RULE_FIRST_INDEX_OUT_OF_BOUNDS = 4602;
2732+
// * PRECEDENCE_RULE_SECOND_INDEX_OUT_OF_BOUNDS = 4603;
2733+
// * PRECEDENCE_RULE_DUPLICATE_INDEX = 4604;
2734+
// * PRECEDENCE_RULE_INEXISTENT_FIRST_VISIT_REQUEST = 4605;
2735+
// * PRECEDENCE_RULE_INEXISTENT_SECOND_VISIT_REQUEST = 4606;
26992736
// * BREAK_ERROR = 48;
27002737
// * BREAK_RULE_EMPTY = 4800;
27012738
// * BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;

0 commit comments

Comments
 (0)