#[non_exhaustive]pub struct Metrics {
pub aggregated_route_metrics: Option<AggregatedMetrics>,
pub skipped_mandatory_shipment_count: i32,
pub used_vehicle_count: i32,
pub earliest_vehicle_start_time: Option<Timestamp>,
pub latest_vehicle_end_time: Option<Timestamp>,
pub costs: HashMap<String, f64>,
pub total_cost: f64,
/* private fields */
}Expand description
Overall metrics, aggregated over all routes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.aggregated_route_metrics: Option<AggregatedMetrics>Aggregated over the routes. Each metric is the sum (or max, for loads) over all ShipmentRoute.metrics fields of the same name.
skipped_mandatory_shipment_count: i32Number of mandatory shipments skipped.
used_vehicle_count: i32Number of vehicles used. Note: if a vehicle route is empty and Vehicle.used_if_route_is_empty is true, the vehicle is considered used.
earliest_vehicle_start_time: Option<Timestamp>The earliest start time for a used vehicle, computed as the minimum over all used vehicles of ShipmentRoute.vehicle_start_time.
latest_vehicle_end_time: Option<Timestamp>The latest end time for a used vehicle, computed as the maximum over all used vehicles of ShipmentRoute.vehicle_end_time.
costs: HashMap<String, f64>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.
total_cost: f64Total cost of the solution. The sum of all values in the costs map.
Implementations§
Source§impl Metrics
impl Metrics
pub fn new() -> Self
Sourcepub fn set_aggregated_route_metrics<T>(self, v: T) -> Selfwhere
T: Into<AggregatedMetrics>,
pub fn set_aggregated_route_metrics<T>(self, v: T) -> Selfwhere
T: Into<AggregatedMetrics>,
Sets the value of aggregated_route_metrics.
Sourcepub fn set_or_clear_aggregated_route_metrics<T>(self, v: Option<T>) -> Selfwhere
T: Into<AggregatedMetrics>,
pub fn set_or_clear_aggregated_route_metrics<T>(self, v: Option<T>) -> Selfwhere
T: Into<AggregatedMetrics>,
Sets or clears the value of aggregated_route_metrics.
Sourcepub fn set_skipped_mandatory_shipment_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_skipped_mandatory_shipment_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of skipped_mandatory_shipment_count.
Sourcepub fn set_used_vehicle_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_used_vehicle_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of used_vehicle_count.
Sourcepub fn set_earliest_vehicle_start_time<T>(self, v: T) -> Self
pub fn set_earliest_vehicle_start_time<T>(self, v: T) -> Self
Sets the value of earliest_vehicle_start_time.
Sourcepub fn set_or_clear_earliest_vehicle_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_earliest_vehicle_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of earliest_vehicle_start_time.
Sourcepub fn set_latest_vehicle_end_time<T>(self, v: T) -> Self
pub fn set_latest_vehicle_end_time<T>(self, v: T) -> Self
Sets the value of latest_vehicle_end_time.
Sourcepub fn set_or_clear_latest_vehicle_end_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_latest_vehicle_end_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of latest_vehicle_end_time.
Sourcepub fn set_total_cost<T: Into<f64>>(self, v: T) -> Self
pub fn set_total_cost<T: Into<f64>>(self, v: T) -> Self
Sets the value of total_cost.