#[non_exhaustive]pub struct TransitionAttributes {
pub src_tag: String,
pub excluded_src_tag: String,
pub dst_tag: String,
pub excluded_dst_tag: String,
pub cost: f64,
pub cost_per_kilometer: f64,
pub distance_limit: Option<DistanceLimit>,
pub delay: Option<Duration>,
/* private fields */
}Expand description
Specifies attributes of transitions between two consecutive visits on a
route. Several TransitionAttributes may apply to the same transition: in
that case, all extra costs add up and the strictest constraint or limit
applies (following natural “AND” semantics).
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.src_tag: StringTags defining the set of (src->dst) transitions these attributes apply to.
A source visit or vehicle start matches iff its
VisitRequest.tags
or Vehicle.start_tags
either contains src_tag or does not contain excluded_src_tag (depending
on which of these two fields is non-empty).
excluded_src_tag: StringSee src_tag. Exactly one of src_tag and excluded_src_tag must be
non-empty.
dst_tag: StringA destination visit or vehicle end matches iff its
VisitRequest.tags
or Vehicle.end_tags either
contains dst_tag or does not contain excluded_dst_tag (depending on
which of these two fields is non-empty).
excluded_dst_tag: StringSee dst_tag. Exactly one of dst_tag and excluded_dst_tag must be
non-empty.
cost: f64Specifies a cost for performing this transition. This is in the same unit as all other costs in the model and must not be negative. It is applied on top of all other existing costs.
cost_per_kilometer: f64Specifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any Vehicle.cost_per_kilometer specified on vehicles.
distance_limit: Option<DistanceLimit>Specifies a limit on the distance traveled while performing this transition.
As of 2021/06, only soft limits are supported.
delay: Option<Duration>Specifies a delay incurred when performing this transition.
This delay always occurs after finishing the source visit and before starting the destination visit.
Implementations§
Source§impl TransitionAttributes
impl TransitionAttributes
pub fn new() -> Self
Sourcepub fn set_src_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_src_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of src_tag.
Sourcepub fn set_excluded_src_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_excluded_src_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of excluded_src_tag.
Sourcepub fn set_dst_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_dst_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of dst_tag.
Sourcepub fn set_excluded_dst_tag<T: Into<String>>(self, v: T) -> Self
pub fn set_excluded_dst_tag<T: Into<String>>(self, v: T) -> Self
Sets the value of excluded_dst_tag.
Sourcepub fn set_cost_per_kilometer<T: Into<f64>>(self, v: T) -> Self
pub fn set_cost_per_kilometer<T: Into<f64>>(self, v: T) -> Self
Sets the value of cost_per_kilometer.
Sourcepub fn set_distance_limit<T>(self, v: T) -> Selfwhere
T: Into<DistanceLimit>,
pub fn set_distance_limit<T>(self, v: T) -> Selfwhere
T: Into<DistanceLimit>,
Sets the value of distance_limit.
Sourcepub fn set_or_clear_distance_limit<T>(self, v: Option<T>) -> Selfwhere
T: Into<DistanceLimit>,
pub fn set_or_clear_distance_limit<T>(self, v: Option<T>) -> Selfwhere
T: Into<DistanceLimit>,
Sets or clears the value of distance_limit.
Trait Implementations§
Source§impl Clone for TransitionAttributes
impl Clone for TransitionAttributes
Source§fn clone(&self) -> TransitionAttributes
fn clone(&self) -> TransitionAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more