# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::OptimizeToursResponse::Metrics (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.0 0.9.2 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.1 0.1.1 Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::OptimizeToursResponse::Metrics.

Overall metrics, aggregated over all routes.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #aggregated_route_metrics

    def aggregated_route_metrics() -> ::Google::Cloud::Optimization::V1::AggregatedMetrics

**Returns**

- ([::Google::Cloud::Optimization::V1::AggregatedMetrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-AggregatedMetrics)) --- Aggregated over the routes. Each metric is the sum (or max, for loads) over all [ShipmentRoute.metrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_metrics_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#metrics (method)") fields of the same name.

### #aggregated_route_metrics=

    def aggregated_route_metrics=(value) -> ::Google::Cloud::Optimization::V1::AggregatedMetrics

**Parameter**

- **value** ([::Google::Cloud::Optimization::V1::AggregatedMetrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-AggregatedMetrics)) --- Aggregated over the routes. Each metric is the sum (or max, for loads) over all [ShipmentRoute.metrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_metrics_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#metrics (method)") fields of the same name.
**Returns**

- ([::Google::Cloud::Optimization::V1::AggregatedMetrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-AggregatedMetrics)) --- Aggregated over the routes. Each metric is the sum (or max, for loads) over all [ShipmentRoute.metrics](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_metrics_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#metrics (method)") fields of the same name.

### #costs

    def costs() -> ::Google::Protobuf::Map{::String => ::Float}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::Float}) --- Cost of the solution, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole solution. In other words, costs\["model.shipments.pickups.cost"\] is the sum of all pickup costs over the solution. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.

### #costs=

    def costs=(value) -> ::Google::Protobuf::Map{::String => ::Float}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::Float}) --- Cost of the solution, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole solution. In other words, costs\["model.shipments.pickups.cost"\] is the sum of all pickup costs over the solution. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::Float}) --- Cost of the solution, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole solution. In other words, costs\["model.shipments.pickups.cost"\] is the sum of all pickup costs over the solution. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.

### #earliest_vehicle_start_time

    def earliest_vehicle_start_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The earliest start time for a used vehicle, computed as the minimum over all used vehicles of [ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_start_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_start_time (method)").

### #earliest_vehicle_start_time=

    def earliest_vehicle_start_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The earliest start time for a used vehicle, computed as the minimum over all used vehicles of [ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_start_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_start_time (method)").
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The earliest start time for a used vehicle, computed as the minimum over all used vehicles of [ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_start_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_start_time (method)").

### #latest_vehicle_end_time

    def latest_vehicle_end_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The latest end time for a used vehicle, computed as the maximum over all used vehicles of [ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_end_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_end_time (method)").

### #latest_vehicle_end_time=

    def latest_vehicle_end_time=(value) -> ::Google::Protobuf::Timestamp

**Parameter**

- **value** ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The latest end time for a used vehicle, computed as the maximum over all used vehicles of [ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_end_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_end_time (method)").
**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Protobuf-Timestamp)) --- The latest end time for a used vehicle, computed as the maximum over all used vehicles of [ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute#Google__Cloud__Optimization__V1__ShipmentRoute_vehicle_end_time_instance_ "Google::Cloud::Optimization::V1::ShipmentRoute#vehicle_end_time (method)").

### #skipped_mandatory_shipment_count

    def skipped_mandatory_shipment_count() -> ::Integer

**Returns**

- (::Integer) --- Number of mandatory shipments skipped.

### #skipped_mandatory_shipment_count=

    def skipped_mandatory_shipment_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Number of mandatory shipments skipped.
**Returns**

- (::Integer) --- Number of mandatory shipments skipped.

### #total_cost

    def total_cost() -> ::Float

**Returns**

- (::Float) --- Total cost of the solution. The sum of all values in the costs map.

### #total_cost=

    def total_cost=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Total cost of the solution. The sum of all values in the costs map.
**Returns**

- (::Float) --- Total cost of the solution. The sum of all values in the costs map.

### #used_vehicle_count

    def used_vehicle_count() -> ::Integer

**Returns**

- (::Integer) --- Number of vehicles used. Note: if a vehicle route is empty and [Vehicle.used_if_route_is_empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_used_if_route_is_empty_instance_ "Google::Cloud::Optimization::V1::Vehicle#used_if_route_is_empty (method)") is true, the vehicle is considered used.

### #used_vehicle_count=

    def used_vehicle_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Number of vehicles used. Note: if a vehicle route is empty and [Vehicle.used_if_route_is_empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_used_if_route_is_empty_instance_ "Google::Cloud::Optimization::V1::Vehicle#used_if_route_is_empty (method)") is true, the vehicle is considered used.
**Returns**

- (::Integer) --- Number of vehicles used. Note: if a vehicle route is empty and [Vehicle.used_if_route_is_empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_used_if_route_is_empty_instance_ "Google::Cloud::Optimization::V1::Vehicle#used_if_route_is_empty (method)") is true, the vehicle is considered used.