pub struct Vehicle {
Show 26 fields pub display_name: String, pub travel_mode: i32, pub route_modifiers: Option<RouteModifiers>, pub start_location: Option<LatLng>, pub start_waypoint: Option<Waypoint>, pub end_location: Option<LatLng>, pub end_waypoint: Option<Waypoint>, pub start_tags: Vec<String>, pub end_tags: Vec<String>, pub start_time_windows: Vec<TimeWindow>, pub end_time_windows: Vec<TimeWindow>, pub travel_duration_multiple: Option<f64>, pub unloading_policy: i32, pub load_limits: HashMap<String, LoadLimit>, pub cost_per_hour: f64, pub cost_per_traveled_hour: f64, pub cost_per_kilometer: f64, pub fixed_cost: f64, pub used_if_route_is_empty: bool, pub route_duration_limit: Option<DurationLimit>, pub travel_duration_limit: Option<DurationLimit>, pub route_distance_limit: Option<DistanceLimit>, pub extra_visit_duration_for_visit_type: HashMap<String, Duration>, pub break_rule: Option<BreakRule>, pub label: String, pub ignore: bool,
}
Expand description

Models a vehicle in a shipment problem. Solving a shipment problem will build a route starting from start_location and ending at end_location for this vehicle. A route is a sequence of visits (see ShipmentRoute).

Fields§

§display_name: String

The user-defined display name of the vehicle. It can be up to 63 characters long and may use UTF-8 characters.

§travel_mode: i32

The travel mode which affects the roads usable by the vehicle and its speed. See also travel_duration_multiple.

§route_modifiers: Option<RouteModifiers>

A set of conditions to satisfy that affect the way routes are calculated for the given vehicle.

§start_location: Option<LatLng>

Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_location must not be specified.

§start_waypoint: Option<Waypoint>

Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither start_waypoint nor start_location is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_waypoint must not be specified.

§end_location: Option<LatLng>

Geographic location where the vehicle ends after it has completed its last VisitRequest. If not specified the vehicle’s ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_location must not be specified.

§end_waypoint: Option<Waypoint>

Waypoint representing a geographic location where the vehicle ends after it has completed its last VisitRequest. If neither end_waypoint nor end_location is specified, the vehicle’s ShipmentRoute ends immediately when it completes its last VisitRequest. If the shipment model has duration and distance matrices, end_waypoint must not be specified.

§start_tags: Vec<String>

Specifies tags attached to the start of the vehicle’s route.

Empty or duplicate strings are not allowed.

§end_tags: Vec<String>

Specifies tags attached to the end of the vehicle’s route.

Empty or duplicate strings are not allowed.

§start_time_windows: Vec<TimeWindow>

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] fields). If unspecified, there is no limitation besides those global time limits.

Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order.

cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

§end_time_windows: Vec<TimeWindow>

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see [ShipmentModel.global_*][google.maps.routeoptimization.v1.ShipmentModel.global_start_time] fields). If unspecified, there is no limitation besides those global time limits.

Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order.

cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

§travel_duration_multiple: Option<f64>

Specifies a multiplicative factor that can be used to increase or decrease travel times of this vehicle. For example, setting this to 2.0 means that this vehicle is slower and has travel times that are twice what they are for standard vehicles. This multiple does not affect visit durations. It does affect cost if cost_per_hour or cost_per_traveled_hour are specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle is standard, and this multiple is considered 1.0.

WARNING: Travel times will be rounded to the nearest second after this multiple is applied but before performing any numerical operations, thus, a small multiple may result in a loss of precision.

See also extra_visit_duration_for_visit_type below.

§unloading_policy: i32

Unloading policy enforced on the vehicle.

§load_limits: HashMap<String, LoadLimit>

Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the [Shipment.load_demands][google.maps.routeoptimization.v1.Shipment.load_demands] field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

§cost_per_hour: f64

Vehicle costs: all costs add up and must be in the same unit as [Shipment.penalty_cost][google.maps.routeoptimization.v1.Shipment.penalty_cost].

Cost per hour of the vehicle route. This cost is applied to the total time taken by the route, and includes travel time, waiting time, and visit time. Using cost_per_hour instead of just cost_per_traveled_hour may result in additional latency.

§cost_per_traveled_hour: f64

Cost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (i.e., that reported in [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions]), and excludes waiting time and visit time.

§cost_per_kilometer: f64

Cost per kilometer of the vehicle route. This cost is applied to the distance reported in the [ShipmentRoute.transitions][google.maps.routeoptimization.v1.ShipmentRoute.transitions] and does not apply to any distance implicitly traveled from the arrival_location to the departure_location of a single VisitRequest.

§fixed_cost: f64

Fixed cost applied if this vehicle is used to handle a shipment.

§used_if_route_is_empty: bool

This field only applies to vehicles when their route does not serve any shipments. It indicates if the vehicle should be considered as used or not in this case.

If true, the vehicle goes from its start to its end location even if it doesn’t serve any shipments, and time and distance costs resulting from its start –> end travel are taken into account.

Otherwise, it doesn’t travel from its start to its end location, and no break_rule or delay (from TransitionAttributes) are scheduled for this vehicle. In this case, the vehicle’s ShipmentRoute doesn’t contain any information except for the vehicle index and label.

§route_duration_limit: Option<DurationLimit>

Limit applied to the total duration of the vehicle’s route. In a given OptimizeToursResponse, the route duration of a vehicle is the difference between its vehicle_end_time and vehicle_start_time.

§travel_duration_limit: Option<DurationLimit>

Limit applied to the travel duration of the vehicle’s route. In a given OptimizeToursResponse, the route travel duration is the sum of all its [transitions.travel_duration][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_duration].

§route_distance_limit: Option<DistanceLimit>

Limit applied to the total distance of the vehicle’s route. In a given OptimizeToursResponse, the route distance is the sum of all its [transitions.travel_distance_meters][google.maps.routeoptimization.v1.ShipmentRoute.Transition.travel_distance_meters].

§extra_visit_duration_for_visit_type: HashMap<String, Duration>

Specifies a map from visit_types strings to durations. The duration is time in addition to [VisitRequest.duration][google.maps.routeoptimization.v1.Shipment.VisitRequest.duration] to be taken at visits with the specified visit_types. This extra visit duration adds cost if cost_per_hour is specified. Keys (i.e. visit_types) cannot be empty strings.

If a visit request has multiple types, a duration will be added for each type in the map.

§break_rule: Option<BreakRule>

Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.

§label: String

Specifies a label for this vehicle. This label is reported in the response as the vehicle_label of the corresponding [ShipmentRoute][google.maps.routeoptimization.v1.ShipmentRoute].

§ignore: bool

If true, used_if_route_is_empty must be false, and this vehicle will remain unused.

If a shipment is performed by an ignored vehicle in injected_first_solution_routes, it is skipped in the first solution but is free to be performed in the response.

If a shipment is performed by an ignored vehicle in injected_solution_constraint and any related pickup/delivery is constrained to remain on the vehicle (i.e., not relaxed to level RELAX_ALL_AFTER_THRESHOLD), it is skipped in the response. If a shipment has a non-empty allowed_vehicle_indices field and all of the allowed vehicles are ignored, it is skipped in the response.

Implementations§

Source§

impl Vehicle

Source

pub fn travel_mode(&self) -> TravelMode

Returns the enum value of travel_mode, or the default if the field is set to an invalid enum value.

Source

pub fn set_travel_mode(&mut self, value: TravelMode)

Sets travel_mode to the provided enum value.

Source

pub fn travel_duration_multiple(&self) -> f64

Returns the value of travel_duration_multiple, or the default value if travel_duration_multiple is unset.

Source

pub fn unloading_policy(&self) -> UnloadingPolicy

Returns the enum value of unloading_policy, or the default if the field is set to an invalid enum value.

Source

pub fn set_unloading_policy(&mut self, value: UnloadingPolicy)

Sets unloading_policy to the provided enum value.

Trait Implementations§

Source§

impl Clone for Vehicle

Source§

fn clone(&self) -> Vehicle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Vehicle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Vehicle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for Vehicle

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for Vehicle

Source§

fn eq(&self, other: &Vehicle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Vehicle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more