Skip to main content

decayed_impairment

Function decayed_impairment 

Source
pub fn decayed_impairment(initial: f32, elapsed: f32, rate: f32) -> f32
Expand description

A transient impairment decaying linearly toward zero — a conservative clearance model (e.g. intoxication). initial is the level in [0,1] at t0; rate is decay per elapsed time unit. Returns the clamped residual level at elapsed units.