Class OptimizeToursRequest.Builder (1.28.0)

public static final class OptimizeToursRequest.Builder extends GeneratedMessageV3.Builder<OptimizeToursRequest.Builder> implements OptimizeToursRequestOrBuilder

Request to be given to a tour optimization solver which defines the shipment model to solve as well as optimization parameters.

Protobuf type google.cloud.optimization.v1.OptimizeToursRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllInjectedFirstSolutionRoutes(Iterable<? extends ShipmentRoute> values)

public OptimizeToursRequest.Builder addAllInjectedFirstSolutionRoutes(Iterable<? extends ShipmentRoute> values)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.optimization.v1.ShipmentRoute>
Returns
TypeDescription
OptimizeToursRequest.Builder

addAllRefreshDetailsRoutes(Iterable<? extends ShipmentRoute> values)

public OptimizeToursRequest.Builder addAllRefreshDetailsRoutes(Iterable<? extends ShipmentRoute> values)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.optimization.v1.ShipmentRoute>
Returns
TypeDescription
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(ShipmentRoute value)

public OptimizeToursRequest.Builder addInjectedFirstSolutionRoutes(ShipmentRoute value)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder addInjectedFirstSolutionRoutes(ShipmentRoute.Builder builderForValue)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

public OptimizeToursRequest.Builder addInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
NameDescription
indexint
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder addInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
NameDescription
indexint
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutesBuilder()

public ShipmentRoute.Builder addInjectedFirstSolutionRoutesBuilder()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
ShipmentRoute.Builder

addInjectedFirstSolutionRoutesBuilder(int index)

public ShipmentRoute.Builder addInjectedFirstSolutionRoutesBuilder(int index)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute.Builder

addRefreshDetailsRoutes(ShipmentRoute value)

public OptimizeToursRequest.Builder addRefreshDetailsRoutes(ShipmentRoute value)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder addRefreshDetailsRoutes(ShipmentRoute.Builder builderForValue)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(int index, ShipmentRoute value)

public OptimizeToursRequest.Builder addRefreshDetailsRoutes(int index, ShipmentRoute value)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
NameDescription
indexint
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder addRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
NameDescription
indexint
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

addRefreshDetailsRoutesBuilder()

public ShipmentRoute.Builder addRefreshDetailsRoutesBuilder()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
ShipmentRoute.Builder

addRefreshDetailsRoutesBuilder(int index)

public ShipmentRoute.Builder addRefreshDetailsRoutesBuilder(int index)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public OptimizeToursRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

build()

public OptimizeToursRequest build()
Returns
TypeDescription
OptimizeToursRequest

buildPartial()

public OptimizeToursRequest buildPartial()
Returns
TypeDescription
OptimizeToursRequest

clear()

public OptimizeToursRequest.Builder clear()
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

clearAllowLargeDeadlineDespiteInterruptionRisk()

public OptimizeToursRequest.Builder clearAllowLargeDeadlineDespiteInterruptionRisk()

If this is set, then the request can have a deadline (see https://grpc.io/blog/deadlines) of up to 60 minutes. Otherwise, the maximum deadline is only 30 minutes. Note that long-lived requests have a significantly larger (but still small) risk of interruption.

bool allow_large_deadline_despite_interruption_risk = 14;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearConsiderRoadTraffic()

public OptimizeToursRequest.Builder clearConsiderRoadTraffic()

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public OptimizeToursRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

clearGeodesicMetersPerSecond()

public OptimizeToursRequest.Builder clearGeodesicMetersPerSecond()

When use_geodesic_distances is true, this field must be set and defines the speed applied to compute travel times. Its value must be at least 1.0 meters/seconds.

optional double geodesic_meters_per_second = 16;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearInjectedFirstSolutionRoutes()

public OptimizeToursRequest.Builder clearInjectedFirstSolutionRoutes()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
OptimizeToursRequest.Builder

clearInjectedSolutionConstraint()

public OptimizeToursRequest.Builder clearInjectedSolutionConstraint()

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
TypeDescription
OptimizeToursRequest.Builder

clearInterpretInjectedSolutionsUsingLabels()

public OptimizeToursRequest.Builder clearInterpretInjectedSolutionsUsingLabels()

If true:

  • uses ShipmentRoute.vehicle_label instead of vehicle_index to match routes in an injected solution with vehicles in the request; reuses the mapping of original ShipmentRoute.vehicle_index to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of SkippedShipment.index to match skipped shipments in the injected solution with request shipments.

    This interpretation applies to the injected_first_solution_routes, injected_solution_constraint, and refresh_details_routes fields. It can be used when shipment or vehicle indices in the request have changed since the solution was created, perhaps because shipments or vehicles have been removed from or added to the request.

    If true, labels in the following categories must appear at most once in their category:

  • Vehicle.label in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and ShipmentRoute.Visit.shipment_label in the injected solution (except pickup/delivery visit pairs, whose shipment_label must appear twice).

    If a vehicle_label in the injected solution does not correspond to a request vehicle, the corresponding route is removed from the solution along with its visits. If a shipment_label in the injected solution does not correspond to a request shipment, the corresponding visit is removed from the solution. If a SkippedShipment.label in the injected solution does not correspond to a request shipment, the SkippedShipment is removed from the solution.

    Removing route visits or entire routes from an injected solution may have an effect on the implied constraints, which may lead to change in solution, validation errors, or infeasibility.

    NOTE: The caller must ensure that each Vehicle.label (resp. Shipment.label) uniquely identifies a vehicle (resp. shipment) entity used across the two relevant requests: the past request that produced the OptimizeToursResponse used in the injected solution and the current request that includes the injected solution. The uniqueness checks described above are not enough to guarantee this requirement.

bool interpret_injected_solutions_using_labels = 10;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearLabel()

public OptimizeToursRequest.Builder clearLabel()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearMaxValidationErrors()

public OptimizeToursRequest.Builder clearMaxValidationErrors()

Truncates the number of validation errors returned. These errors are typically attached to an INVALID_ARGUMENT error payload as a BadRequest error detail (https://cloud.google.com/apis/design/errors#error_details), unless solving_mode=VALIDATE_ONLY: see the OptimizeToursResponse.validation_errors field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearModel()

public OptimizeToursRequest.Builder clearModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
TypeDescription
OptimizeToursRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public OptimizeToursRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

clearParent()

public OptimizeToursRequest.Builder clearParent()

Required. Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulatePolylines()

public OptimizeToursRequest.Builder clearPopulatePolylines()

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulateTransitionPolylines()

public OptimizeToursRequest.Builder clearPopulateTransitionPolylines()

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulateTravelStepPolylines() (deprecated)

public OptimizeToursRequest.Builder clearPopulateTravelStepPolylines()

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearRefreshDetailsRoutes()

public OptimizeToursRequest.Builder clearRefreshDetailsRoutes()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
OptimizeToursRequest.Builder

clearSearchMode()

public OptimizeToursRequest.Builder clearSearchMode()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearSolvingMode()

public OptimizeToursRequest.Builder clearSolvingMode()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clearTimeout()

public OptimizeToursRequest.Builder clearTimeout()

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Returns
TypeDescription
OptimizeToursRequest.Builder

clearUseGeodesicDistances()

public OptimizeToursRequest.Builder clearUseGeodesicDistances()

If true, travel distances will be computed using geodesic distances instead of Google Maps distances, and travel times will be computed using geodesic distances with a speed defined by geodesic_meters_per_second.

bool use_geodesic_distances = 15;

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

clone()

public OptimizeToursRequest.Builder clone()
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

getAllowLargeDeadlineDespiteInterruptionRisk()

public boolean getAllowLargeDeadlineDespiteInterruptionRisk()

If this is set, then the request can have a deadline (see https://grpc.io/blog/deadlines) of up to 60 minutes. Otherwise, the maximum deadline is only 30 minutes. Note that long-lived requests have a significantly larger (but still small) risk of interruption.

bool allow_large_deadline_despite_interruption_risk = 14;

Returns
TypeDescription
boolean

The allowLargeDeadlineDespiteInterruptionRisk.

getConsiderRoadTraffic()

public boolean getConsiderRoadTraffic()

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Returns
TypeDescription
boolean

The considerRoadTraffic.

getDefaultInstanceForType()

public OptimizeToursRequest getDefaultInstanceForType()
Returns
TypeDescription
OptimizeToursRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getGeodesicMetersPerSecond()

public double getGeodesicMetersPerSecond()

When use_geodesic_distances is true, this field must be set and defines the speed applied to compute travel times. Its value must be at least 1.0 meters/seconds.

optional double geodesic_meters_per_second = 16;

Returns
TypeDescription
double

The geodesicMetersPerSecond.

getInjectedFirstSolutionRoutes(int index)

public ShipmentRoute getInjectedFirstSolutionRoutes(int index)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute

getInjectedFirstSolutionRoutesBuilder(int index)

public ShipmentRoute.Builder getInjectedFirstSolutionRoutesBuilder(int index)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute.Builder

getInjectedFirstSolutionRoutesBuilderList()

public List<ShipmentRoute.Builder> getInjectedFirstSolutionRoutesBuilderList()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
List<Builder>

getInjectedFirstSolutionRoutesCount()

public int getInjectedFirstSolutionRoutesCount()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
int

getInjectedFirstSolutionRoutesList()

public List<ShipmentRoute> getInjectedFirstSolutionRoutesList()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
List<ShipmentRoute>

getInjectedFirstSolutionRoutesOrBuilder(int index)

public ShipmentRouteOrBuilder getInjectedFirstSolutionRoutesOrBuilder(int index)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRouteOrBuilder

getInjectedFirstSolutionRoutesOrBuilderList()

public List<? extends ShipmentRouteOrBuilder> getInjectedFirstSolutionRoutesOrBuilderList()

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>

getInjectedSolutionConstraint()

public InjectedSolutionConstraint getInjectedSolutionConstraint()

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
TypeDescription
InjectedSolutionConstraint

The injectedSolutionConstraint.

getInjectedSolutionConstraintBuilder()

public InjectedSolutionConstraint.Builder getInjectedSolutionConstraintBuilder()

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
TypeDescription
InjectedSolutionConstraint.Builder

getInjectedSolutionConstraintOrBuilder()

public InjectedSolutionConstraintOrBuilder getInjectedSolutionConstraintOrBuilder()

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
TypeDescription
InjectedSolutionConstraintOrBuilder

getInterpretInjectedSolutionsUsingLabels()

public boolean getInterpretInjectedSolutionsUsingLabels()

If true:

  • uses ShipmentRoute.vehicle_label instead of vehicle_index to match routes in an injected solution with vehicles in the request; reuses the mapping of original ShipmentRoute.vehicle_index to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of SkippedShipment.index to match skipped shipments in the injected solution with request shipments.

    This interpretation applies to the injected_first_solution_routes, injected_solution_constraint, and refresh_details_routes fields. It can be used when shipment or vehicle indices in the request have changed since the solution was created, perhaps because shipments or vehicles have been removed from or added to the request.

    If true, labels in the following categories must appear at most once in their category:

  • Vehicle.label in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and ShipmentRoute.Visit.shipment_label in the injected solution (except pickup/delivery visit pairs, whose shipment_label must appear twice).

    If a vehicle_label in the injected solution does not correspond to a request vehicle, the corresponding route is removed from the solution along with its visits. If a shipment_label in the injected solution does not correspond to a request shipment, the corresponding visit is removed from the solution. If a SkippedShipment.label in the injected solution does not correspond to a request shipment, the SkippedShipment is removed from the solution.

    Removing route visits or entire routes from an injected solution may have an effect on the implied constraints, which may lead to change in solution, validation errors, or infeasibility.

    NOTE: The caller must ensure that each Vehicle.label (resp. Shipment.label) uniquely identifies a vehicle (resp. shipment) entity used across the two relevant requests: the past request that produced the OptimizeToursResponse used in the injected solution and the current request that includes the injected solution. The uniqueness checks described above are not enough to guarantee this requirement.

bool interpret_injected_solutions_using_labels = 10;

Returns
TypeDescription
boolean

The interpretInjectedSolutionsUsingLabels.

getLabel()

public String getLabel()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
TypeDescription
String

The label.

getLabelBytes()

public ByteString getLabelBytes()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
TypeDescription
ByteString

The bytes for label.

getMaxValidationErrors()

public int getMaxValidationErrors()

Truncates the number of validation errors returned. These errors are typically attached to an INVALID_ARGUMENT error payload as a BadRequest error detail (https://cloud.google.com/apis/design/errors#error_details), unless solving_mode=VALIDATE_ONLY: see the OptimizeToursResponse.validation_errors field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
TypeDescription
int

The maxValidationErrors.

getModel()

public ShipmentModel getModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
TypeDescription
ShipmentModel

The model.

getModelBuilder()

public ShipmentModel.Builder getModelBuilder()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
TypeDescription
ShipmentModel.Builder

getModelOrBuilder()

public ShipmentModelOrBuilder getModelOrBuilder()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
TypeDescription
ShipmentModelOrBuilder

getParent()

public String getParent()

Required. Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The parent.

getParentBytes()

public ByteString getParentBytes()

Required. Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for parent.

getPopulatePolylines()

public boolean getPopulatePolylines()

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Returns
TypeDescription
boolean

The populatePolylines.

getPopulateTransitionPolylines()

public boolean getPopulateTransitionPolylines()

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Returns
TypeDescription
boolean

The populateTransitionPolylines.

getPopulateTravelStepPolylines() (deprecated)

public boolean getPopulateTravelStepPolylines()

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Returns
TypeDescription
boolean

The populateTravelStepPolylines.

getRefreshDetailsRoutes(int index)

public ShipmentRoute getRefreshDetailsRoutes(int index)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute

getRefreshDetailsRoutesBuilder(int index)

public ShipmentRoute.Builder getRefreshDetailsRoutesBuilder(int index)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRoute.Builder

getRefreshDetailsRoutesBuilderList()

public List<ShipmentRoute.Builder> getRefreshDetailsRoutesBuilderList()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
List<Builder>

getRefreshDetailsRoutesCount()

public int getRefreshDetailsRoutesCount()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
int

getRefreshDetailsRoutesList()

public List<ShipmentRoute> getRefreshDetailsRoutesList()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
List<ShipmentRoute>

getRefreshDetailsRoutesOrBuilder(int index)

public ShipmentRouteOrBuilder getRefreshDetailsRoutesOrBuilder(int index)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
ShipmentRouteOrBuilder

getRefreshDetailsRoutesOrBuilderList()

public List<? extends ShipmentRouteOrBuilder> getRefreshDetailsRoutesOrBuilderList()

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
TypeDescription
List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>

getSearchMode()

public OptimizeToursRequest.SearchMode getSearchMode()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
TypeDescription
OptimizeToursRequest.SearchMode

The searchMode.

getSearchModeValue()

public int getSearchModeValue()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
TypeDescription
int

The enum numeric value on the wire for searchMode.

getSolvingMode()

public OptimizeToursRequest.SolvingMode getSolvingMode()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
TypeDescription
OptimizeToursRequest.SolvingMode

The solvingMode.

getSolvingModeValue()

public int getSolvingModeValue()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
TypeDescription
int

The enum numeric value on the wire for solvingMode.

getTimeout()

public Duration getTimeout()

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Returns
TypeDescription
Duration

The timeout.

getTimeoutBuilder()

public Duration.Builder getTimeoutBuilder()

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Returns
TypeDescription
Builder

getTimeoutOrBuilder()

public DurationOrBuilder getTimeoutOrBuilder()

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Returns
TypeDescription
DurationOrBuilder

getUseGeodesicDistances()

public boolean getUseGeodesicDistances()

If true, travel distances will be computed using geodesic distances instead of Google Maps distances, and travel times will be computed using geodesic distances with a speed defined by geodesic_meters_per_second.

bool use_geodesic_distances = 15;

Returns
TypeDescription
boolean

The useGeodesicDistances.

hasGeodesicMetersPerSecond()

public boolean hasGeodesicMetersPerSecond()

When use_geodesic_distances is true, this field must be set and defines the speed applied to compute travel times. Its value must be at least 1.0 meters/seconds.

optional double geodesic_meters_per_second = 16;

Returns
TypeDescription
boolean

Whether the geodesicMetersPerSecond field is set.

hasInjectedSolutionConstraint()

public boolean hasInjectedSolutionConstraint()

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
TypeDescription
boolean

Whether the injectedSolutionConstraint field is set.

hasMaxValidationErrors()

public boolean hasMaxValidationErrors()

Truncates the number of validation errors returned. These errors are typically attached to an INVALID_ARGUMENT error payload as a BadRequest error detail (https://cloud.google.com/apis/design/errors#error_details), unless solving_mode=VALIDATE_ONLY: see the OptimizeToursResponse.validation_errors field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
TypeDescription
boolean

Whether the maxValidationErrors field is set.

hasModel()

public boolean hasModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
TypeDescription
boolean

Whether the model field is set.

hasTimeout()

public boolean hasTimeout()

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Returns
TypeDescription
boolean

Whether the timeout field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(OptimizeToursRequest other)

public OptimizeToursRequest.Builder mergeFrom(OptimizeToursRequest other)
Parameter
NameDescription
otherOptimizeToursRequest
Returns
TypeDescription
OptimizeToursRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public OptimizeToursRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public OptimizeToursRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

mergeInjectedSolutionConstraint(InjectedSolutionConstraint value)

public OptimizeToursRequest.Builder mergeInjectedSolutionConstraint(InjectedSolutionConstraint value)

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
NameDescription
valueInjectedSolutionConstraint
Returns
TypeDescription
OptimizeToursRequest.Builder

mergeModel(ShipmentModel value)

public OptimizeToursRequest.Builder mergeModel(ShipmentModel value)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
NameDescription
valueShipmentModel
Returns
TypeDescription
OptimizeToursRequest.Builder

mergeTimeout(Duration value)

public OptimizeToursRequest.Builder mergeTimeout(Duration value)

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
OptimizeToursRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final OptimizeToursRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

removeInjectedFirstSolutionRoutes(int index)

public OptimizeToursRequest.Builder removeInjectedFirstSolutionRoutes(int index)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
OptimizeToursRequest.Builder

removeRefreshDetailsRoutes(int index)

public OptimizeToursRequest.Builder removeRefreshDetailsRoutes(int index)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
OptimizeToursRequest.Builder

setAllowLargeDeadlineDespiteInterruptionRisk(boolean value)

public OptimizeToursRequest.Builder setAllowLargeDeadlineDespiteInterruptionRisk(boolean value)

If this is set, then the request can have a deadline (see https://grpc.io/blog/deadlines) of up to 60 minutes. Otherwise, the maximum deadline is only 30 minutes. Note that long-lived requests have a significantly larger (but still small) risk of interruption.

bool allow_large_deadline_despite_interruption_risk = 14;

Parameter
NameDescription
valueboolean

The allowLargeDeadlineDespiteInterruptionRisk to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setConsiderRoadTraffic(boolean value)

public OptimizeToursRequest.Builder setConsiderRoadTraffic(boolean value)

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Parameter
NameDescription
valueboolean

The considerRoadTraffic to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public OptimizeToursRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

setGeodesicMetersPerSecond(double value)

public OptimizeToursRequest.Builder setGeodesicMetersPerSecond(double value)

When use_geodesic_distances is true, this field must be set and defines the speed applied to compute travel times. Its value must be at least 1.0 meters/seconds.

optional double geodesic_meters_per_second = 16;

Parameter
NameDescription
valuedouble

The geodesicMetersPerSecond to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

public OptimizeToursRequest.Builder setInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
NameDescription
indexint
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

setInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder setInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

Guide the optimization algorithm in finding a first solution that is similar to a previous solution.

The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.

The solution must satisfy some basic validity assumptions:

  • for all routes, vehicle_index must be in range and not be duplicated.
  • for all visits, shipment_index and visit_request_index must be in range.
  • a shipment may only be referenced on one route.
  • the pickup of a pickup-delivery shipment must be performed before the delivery.
  • no more than one pickup alternative or delivery alternative of a shipment may be performed.
  • for all routes, times are increasing (i.e., vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time).
  • a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if Shipment.allowed_vehicle_indices is empty or its vehicle_index is included in Shipment.allowed_vehicle_indices.

    If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
NameDescription
indexint
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

setInjectedSolutionConstraint(InjectedSolutionConstraint value)

public OptimizeToursRequest.Builder setInjectedSolutionConstraint(InjectedSolutionConstraint value)

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
NameDescription
valueInjectedSolutionConstraint
Returns
TypeDescription
OptimizeToursRequest.Builder

setInjectedSolutionConstraint(InjectedSolutionConstraint.Builder builderForValue)

public OptimizeToursRequest.Builder setInjectedSolutionConstraint(InjectedSolutionConstraint.Builder builderForValue)

Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.

If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
NameDescription
builderForValueInjectedSolutionConstraint.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

setInterpretInjectedSolutionsUsingLabels(boolean value)

public OptimizeToursRequest.Builder setInterpretInjectedSolutionsUsingLabels(boolean value)

If true:

  • uses ShipmentRoute.vehicle_label instead of vehicle_index to match routes in an injected solution with vehicles in the request; reuses the mapping of original ShipmentRoute.vehicle_index to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of SkippedShipment.index to match skipped shipments in the injected solution with request shipments.

    This interpretation applies to the injected_first_solution_routes, injected_solution_constraint, and refresh_details_routes fields. It can be used when shipment or vehicle indices in the request have changed since the solution was created, perhaps because shipments or vehicles have been removed from or added to the request.

    If true, labels in the following categories must appear at most once in their category:

  • Vehicle.label in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and ShipmentRoute.Visit.shipment_label in the injected solution (except pickup/delivery visit pairs, whose shipment_label must appear twice).

    If a vehicle_label in the injected solution does not correspond to a request vehicle, the corresponding route is removed from the solution along with its visits. If a shipment_label in the injected solution does not correspond to a request shipment, the corresponding visit is removed from the solution. If a SkippedShipment.label in the injected solution does not correspond to a request shipment, the SkippedShipment is removed from the solution.

    Removing route visits or entire routes from an injected solution may have an effect on the implied constraints, which may lead to change in solution, validation errors, or infeasibility.

    NOTE: The caller must ensure that each Vehicle.label (resp. Shipment.label) uniquely identifies a vehicle (resp. shipment) entity used across the two relevant requests: the past request that produced the OptimizeToursResponse used in the injected solution and the current request that includes the injected solution. The uniqueness checks described above are not enough to guarantee this requirement.

bool interpret_injected_solutions_using_labels = 10;

Parameter
NameDescription
valueboolean

The interpretInjectedSolutionsUsingLabels to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setLabel(String value)

public OptimizeToursRequest.Builder setLabel(String value)

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Parameter
NameDescription
valueString

The label to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setLabelBytes(ByteString value)

public OptimizeToursRequest.Builder setLabelBytes(ByteString value)

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Parameter
NameDescription
valueByteString

The bytes for label to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setMaxValidationErrors(int value)

public OptimizeToursRequest.Builder setMaxValidationErrors(int value)

Truncates the number of validation errors returned. These errors are typically attached to an INVALID_ARGUMENT error payload as a BadRequest error detail (https://cloud.google.com/apis/design/errors#error_details), unless solving_mode=VALIDATE_ONLY: see the OptimizeToursResponse.validation_errors field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Parameter
NameDescription
valueint

The maxValidationErrors to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setModel(ShipmentModel value)

public OptimizeToursRequest.Builder setModel(ShipmentModel value)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
NameDescription
valueShipmentModel
Returns
TypeDescription
OptimizeToursRequest.Builder

setModel(ShipmentModel.Builder builderForValue)

public OptimizeToursRequest.Builder setModel(ShipmentModel.Builder builderForValue)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
NameDescription
builderForValueShipmentModel.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

setParent(String value)

public OptimizeToursRequest.Builder setParent(String value)

Required. Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The parent to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

public OptimizeToursRequest.Builder setParentBytes(ByteString value)

Required. Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for parent to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setPopulatePolylines(boolean value)

public OptimizeToursRequest.Builder setPopulatePolylines(boolean value)

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Parameter
NameDescription
valueboolean

The populatePolylines to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setPopulateTransitionPolylines(boolean value)

public OptimizeToursRequest.Builder setPopulateTransitionPolylines(boolean value)

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Parameter
NameDescription
valueboolean

The populateTransitionPolylines to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setPopulateTravelStepPolylines(boolean value) (deprecated)

public OptimizeToursRequest.Builder setPopulateTravelStepPolylines(boolean value)

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Parameter
NameDescription
valueboolean

The populateTravelStepPolylines to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setRefreshDetailsRoutes(int index, ShipmentRoute value)

public OptimizeToursRequest.Builder setRefreshDetailsRoutes(int index, ShipmentRoute value)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
NameDescription
indexint
valueShipmentRoute
Returns
TypeDescription
OptimizeToursRequest.Builder

setRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

public OptimizeToursRequest.Builder setRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.

As of 2020/11, this only populates the polylines of non-empty routes and requires that populate_polylines is true.

The route_polyline fields of the passed-in routes may be inconsistent with route transitions.

This field must not be used together with injected_first_solution_routes or injected_solution_constraint.

Shipment.ignore and Vehicle.ignore have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
NameDescription
indexint
builderForValueShipmentRoute.Builder
Returns
TypeDescription
OptimizeToursRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public OptimizeToursRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

setSearchMode(OptimizeToursRequest.SearchMode value)

public OptimizeToursRequest.Builder setSearchMode(OptimizeToursRequest.SearchMode value)

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Parameter
NameDescription
valueOptimizeToursRequest.SearchMode

The searchMode to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setSearchModeValue(int value)

public OptimizeToursRequest.Builder setSearchModeValue(int value)

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Parameter
NameDescription
valueint

The enum numeric value on the wire for searchMode to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setSolvingMode(OptimizeToursRequest.SolvingMode value)

public OptimizeToursRequest.Builder setSolvingMode(OptimizeToursRequest.SolvingMode value)

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Parameter
NameDescription
valueOptimizeToursRequest.SolvingMode

The solvingMode to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setSolvingModeValue(int value)

public OptimizeToursRequest.Builder setSolvingModeValue(int value)

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Parameter
NameDescription
valueint

The enum numeric value on the wire for solvingMode to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.

setTimeout(Duration value)

public OptimizeToursRequest.Builder setTimeout(Duration value)

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
OptimizeToursRequest.Builder

setTimeout(Duration.Builder builderForValue)

public OptimizeToursRequest.Builder setTimeout(Duration.Builder builderForValue)

If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.

For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.

.google.protobuf.Duration timeout = 2;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
OptimizeToursRequest.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final OptimizeToursRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
OptimizeToursRequest.Builder
Overrides

setUseGeodesicDistances(boolean value)

public OptimizeToursRequest.Builder setUseGeodesicDistances(boolean value)

If true, travel distances will be computed using geodesic distances instead of Google Maps distances, and travel times will be computed using geodesic distances with a speed defined by geodesic_meters_per_second.

bool use_geodesic_distances = 15;

Parameter
NameDescription
valueboolean

The useGeodesicDistances to set.

Returns
TypeDescription
OptimizeToursRequest.Builder

This builder for chaining.