Class: Google::Cloud::Optimization::V1::OptimizeToursRequest

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/optimization/v1/fleet_routing.rb

Overview

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

Defined Under Namespace

Modules: SearchMode, SolvingMode

Instance Attribute Summary collapse

Instance Attribute Details

#allow_large_deadline_despite_interruption_risk::Boolean

Returns 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.

Returns:

  • (::Boolean)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#consider_road_traffic::Boolean

Returns 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.

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#geodesic_meters_per_second::Float

Returns 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.

Returns:

  • (::Float)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#injected_first_solution_routes::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>

Returns 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.

Returns:

  • (::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#injected_solution_constraint::Google::Cloud::Optimization::V1::InjectedSolutionConstraint

Returns 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.

Returns:

  • (::Google::Cloud::Optimization::V1::InjectedSolutionConstraint)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#interpret_injected_solutions_using_labels::Boolean

Returns If true:

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:

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.

Returns:

  • (::Boolean)

    If true:

    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:

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#label::String

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

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#max_validation_errors::Integer

Returns 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.

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#model::Google::Cloud::Optimization::V1::ShipmentModel

Returns Shipment model to solve.

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#parent::String

Returns 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.

Returns:

  • (::String)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#populate_polylines::Boolean

Returns If true, polylines will be populated in response ShipmentRoutes.

Returns:

  • (::Boolean)

    If true, polylines will be populated in response ShipmentRoutes.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#populate_transition_polylines::Boolean

Returns 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.

Returns:

  • (::Boolean)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#populate_travel_step_polylines::Boolean

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns 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.

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#refresh_details_routes::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>

Returns 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.

Returns:

  • (::Array<::Google::Cloud::Optimization::V1::ShipmentRoute>)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#search_mode::Google::Cloud::Optimization::V1::OptimizeToursRequest::SearchMode

Returns Search mode used to solve the request.

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#solving_mode::Google::Cloud::Optimization::V1::OptimizeToursRequest::SolvingMode

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

Returns:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#timeout::Google::Protobuf::Duration

Returns 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.

Returns:

  • (::Google::Protobuf::Duration)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end

#use_geodesic_distances::Boolean

Returns 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.

Returns:

  • (::Boolean)

    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.



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 234

class OptimizeToursRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Defines how the solver should handle the request. In all modes but
  # `VALIDATE_ONLY`, if the request is invalid, you will receive an
  # `INVALID_REQUEST` error. See
  # {::Google::Cloud::Optimization::V1::OptimizeToursRequest#max_validation_errors max_validation_errors}
  # to cap the number of errors returned.
  module SolvingMode
    # Solve the model.
    DEFAULT_SOLVE = 0

    # Only validates the model without solving it: populates as many
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # as possible.
    VALIDATE_ONLY = 1

    # Only populates
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # or
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments},
    # and doesn't actually solve the rest of the request (`status` and `routes`
    # are unset in the response).
    # If infeasibilities in `injected_solution_constraint` routes are detected
    # they are populated in the
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#validation_errors OptimizeToursResponse.validation_errors}
    # field and
    # {::Google::Cloud::Optimization::V1::OptimizeToursResponse#skipped_shipments OptimizeToursResponse.skipped_shipments}
    # is left empty.
    #
    # *IMPORTANT*: not all infeasible shipments are returned here, but only the
    # ones that are detected as infeasible during preprocessing.
    DETECT_SOME_INFEASIBLE_SHIPMENTS = 2
  end

  # Mode defining the behavior of the search, trading off latency versus
  # solution quality. In all modes, the global request deadline is enforced.
  module SearchMode
    # Unspecified search mode, equivalent to `RETURN_FAST`.
    SEARCH_MODE_UNSPECIFIED = 0

    # Stop the search after finding the first good solution.
    RETURN_FAST = 1

    # Spend all the available time to search for better solutions.
    CONSUME_ALL_AVAILABLE_TIME = 2
  end
end