#[non_exhaustive]pub struct PassingInfo {
pub passing_detected: bool,
pub index: usize,
pub num_steps: usize,
pub start_distance: Length,
pub distance: Length,
pub start_speed: Velocity,
pub speed: Velocity,
pub time_step_duration: Time,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.passing_detected: boolTrue if first cycle passes the second; NOTE: was has_collision
index: usizethe index where first cycle passes the second; NOTE: was idx
num_steps: usizethe number of time-steps until index from i
start_distance: Lengththe starting distance of the first cycle at i
distance: Lengththe distance traveled of the second cycle when the first passes
start_speed: Velocitythe starting speed of the first cycle at i
speed: Velocitythe speed of the second cycle when first passes
time_step_duration: Timethe (assumed constant) time step duration throughout the passing investigation
Implementations§
Source§impl PassingInfo
impl PassingInfo
Sourcepub fn from(
cyc: &Cycle,
cyc_ref: &Cycle,
i: usize,
distance_tolerance: Option<Length>,
) -> Self
pub fn from( cyc: &Cycle, cyc_ref: &Cycle, i: usize, distance_tolerance: Option<Length>, ) -> Self
Create a new PassingInfo struct from a cycle and reference cycle.
- cyc: the cycle to detect passing for
- cyc0: the reference cycle / lead vehicle / shadow cycle to compare cyc with
- i: the time-step index for the start of consideration
- distance_tolerance: the distance away from the lead vehicle at or above which we consider ourselves “deviated” or “no longer following” the reference trace
RETURN: a PassingInfo structure
Trait Implementations§
Source§impl Clone for PassingInfo
impl Clone for PassingInfo
Source§fn clone(&self) -> PassingInfo
fn clone(&self) -> PassingInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PassingInfo
impl Debug for PassingInfo
Source§impl Default for PassingInfo
impl Default for PassingInfo
Source§fn default() -> PassingInfo
fn default() -> PassingInfo
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PassingInfo
impl<'de> Deserialize<'de> for PassingInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PassingInfo
impl PartialEq for PassingInfo
Source§impl Serialize for PassingInfo
impl Serialize for PassingInfo
impl StructuralPartialEq for PassingInfo
Auto Trait Implementations§
impl Freeze for PassingInfo
impl RefUnwindSafe for PassingInfo
impl Send for PassingInfo
impl Sync for PassingInfo
impl Unpin for PassingInfo
impl UnwindSafe for PassingInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more