pub struct TierPolicy {
pub radii: [f32; 4],
pub hysteresis: f32,
pub min_dwell: f32,
}Expand description
Wechselregel inkl. Gedenksekunden.
Fields§
§radii: [f32; 4]Maximaldistanz für T0..T3; darüber ist T4. Muss streng monoton steigend sein.
hysteresis: f32Hysterese-Anteil, z. B. 0.1 = 10 % breitere Wechselzone.
min_dwell: f32Sekunden, die eine Stufe mindestens hält, bevor sie wieder darf.
Implementations§
Source§impl TierPolicy
impl TierPolicy
Sourcepub fn update(&self, state: &mut TierState, dist: f32, now: f32) -> Option<Tier>
pub fn update(&self, state: &mut TierState, dist: f32, now: f32) -> Option<Tier>
Ein Update-Schritt: liefert die neue Stufe, falls TierState
sich ändert, sonst None. now ist Weltzeit in Sekunden.
Regeln: Besser werden will dist < r_fein · (1−h), schlechter
werden dist > r_grob · (1+h); beides nur nach Ablauf der
Verweilzeit. Sprünge über mehrere Stufen sind erlaubt (Teleport).
Trait Implementations§
Source§impl Clone for TierPolicy
impl Clone for TierPolicy
Source§fn clone(&self) -> TierPolicy
fn clone(&self) -> TierPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TierPolicy
Source§impl Debug for TierPolicy
impl Debug for TierPolicy
Source§impl Default for TierPolicy
impl Default for TierPolicy
Source§impl PartialEq for TierPolicy
impl PartialEq for TierPolicy
Source§fn eq(&self, other: &TierPolicy) -> bool
fn eq(&self, other: &TierPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TierPolicy
Auto Trait Implementations§
impl Freeze for TierPolicy
impl RefUnwindSafe for TierPolicy
impl Send for TierPolicy
impl Sync for TierPolicy
impl Unpin for TierPolicy
impl UnsafeUnpin for TierPolicy
impl UnwindSafe for TierPolicy
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