pub struct TrackingPolicy { /* private fields */ }Expand description
Track acquisition and loss thresholds: vessel settings.
Validated by TrackingPolicy::new: at least one fix to acquire, lost
timeout ≥ stale timeout, positive maximum speed.
Implementations§
Source§impl TrackingPolicy
impl TrackingPolicy
Sourcepub fn new(
fixes_to_acquire: u8,
stale_after: Duration,
lost_after: Duration,
max_speed: Speed,
) -> Result<Self>
pub fn new( fixes_to_acquire: u8, stale_after: Duration, lost_after: Duration, max_speed: Speed, ) -> Result<Self>
Policy from four thresholds; full picture refuses newcomers.
fixes_to_acquire: observations beforeTrafficEvent::TargetAcquired(3 is the radar convention; AIS can be trusted from the first).stale_after: time since the last observation after which the track is marked stale in the view (still shown and extrapolated).lost_after(≥stale_after): time after whichTraffic::sweepdrops the track withTrafficEvent::TargetLost.max_speed: maximum plausible target speed; an observation implying more is rejected as an implausible jump (swapped track, corrupt report).
§Errors
KernelError::OutOfRange for zero fixes, lost_after < stale_after,
or a non-positive speed.
Sourcepub const fn fixes_to_acquire(&self) -> u8
pub const fn fixes_to_acquire(&self) -> u8
Observations needed to acquire.
Sourcepub const fn stale_after(&self) -> Duration
pub const fn stale_after(&self) -> Duration
Stale timeout.
Sourcepub const fn lost_after(&self) -> Duration
pub const fn lost_after(&self) -> Duration
Lost timeout.
Trait Implementations§
Source§impl Clone for TrackingPolicy
impl Clone for TrackingPolicy
impl Copy for TrackingPolicy
Source§impl Debug for TrackingPolicy
impl Debug for TrackingPolicy
Source§impl PartialEq for TrackingPolicy
impl PartialEq for TrackingPolicy
impl StructuralPartialEq for TrackingPolicy
Auto Trait Implementations§
impl Freeze for TrackingPolicy
impl RefUnwindSafe for TrackingPolicy
impl Send for TrackingPolicy
impl Sync for TrackingPolicy
impl Unpin for TrackingPolicy
impl UnsafeUnpin for TrackingPolicy
impl UnwindSafe for TrackingPolicy
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