A service for optimizing vehicle tours.
Validity of certain types of fields:
google.protobuf.Timestamp
- Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
- seconds must be in [0, 253402300799], i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- nanos must be unset or set to 0.
google.protobuf.Duration
- seconds must be in [0, 253402300799], i.e. in [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- nanos must be unset or set to 0.
google.type.LatLng
- latitude must be in [-90.0, 90.0].
- longitude must be in [-180.0, 180.0].
- at least one of latitude and longitude must be non-zero.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
FleetRoutingClient(FleetRoutingClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
FleetRoutingClient const &
|
FleetRoutingClient(FleetRoutingClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
FleetRoutingClient &&
|
FleetRoutingClient(std::shared_ptr< FleetRoutingConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< FleetRoutingConnection >
|
opts |
Options
|
Operators
operator=(FleetRoutingClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
FleetRoutingClient const &
|
Returns | |
---|---|
Type | Description |
FleetRoutingClient & |
operator=(FleetRoutingClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
FleetRoutingClient &&
|
Returns | |
---|---|
Type | Description |
FleetRoutingClient & |
Functions
OptimizeTours(google::cloud::optimization::v1::OptimizeToursRequest const &, Options)
Sends an OptimizeToursRequest
containing a ShipmentModel
and returns an OptimizeToursResponse
containing ShipmentRoute
s, which are a set of routes to be performed by vehicles minimizing the overall cost.
A ShipmentModel
model consists mainly of Shipment
s that need to be carried out and Vehicle
s that can be used to transport the Shipment
s. The ShipmentRoute
s assign Shipment
s to Vehicle
s. More specifically, they assign a series of Visit
s to each vehicle, where a Visit
corresponds to a VisitRequest
, which is a pickup or delivery for a Shipment
.
The goal is to provide an assignment of ShipmentRoute
s to Vehicle
s that minimizes the total cost where cost has many components defined in the ShipmentModel
.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::optimization::v1::OptimizeToursRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::optimization::v1::OptimizeToursResponse > |
the result of the RPC. The response message type (google.cloud.optimization.v1.OptimizeToursResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
BatchOptimizeTours(google::cloud::optimization::v1::BatchOptimizeToursRequest const &, Options)
Optimizes vehicle tours for one or more OptimizeToursRequest
messages as a batch.
This method is a Long Running Operation (LRO). The inputs for optimization (OptimizeToursRequest
messages) and outputs (OptimizeToursResponse
messages) are read/written from/to Cloud Storage in user-specified format. Like the OptimizeTours
method, each OptimizeToursRequest
contains a ShipmentModel
and returns an OptimizeToursResponse
containing ShipmentRoute
s, which are a set of routes to be performed by vehicles minimizing the overall cost.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::optimization::v1::BatchOptimizeToursRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::optimization::v1::BatchOptimizeToursResponse > > |
A |
BatchOptimizeTours(NoAwaitTag, google::cloud::optimization::v1::BatchOptimizeToursRequest const &, Options)
Optimizes vehicle tours for one or more OptimizeToursRequest
messages as a batch.
Specifying the NoAwaitTag
immediately returns the [google::longrunning::Operation
] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.
Parameters | |
---|---|
Name | Description |
|
NoAwaitTag
|
request |
google::cloud::optimization::v1::BatchOptimizeToursRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
BatchOptimizeTours(google::longrunning::Operation const &, Options)
Optimizes vehicle tours for one or more OptimizeToursRequest
messages as a batch.
This method accepts a google::longrunning::Operation
that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.
Parameters | |
---|---|
Name | Description |
operation |
google::longrunning::Operation const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::optimization::v1::BatchOptimizeToursResponse > > |