Skip to main content

transition_allowed

Function transition_allowed 

Source
pub fn transition_allowed(
    from: LifecycleState,
    to: LifecycleState,
    stats: &SkillStats,
    now: DateTime<Utc>,
) -> bool
Expand description

Returns true if the transition from from to to may be persisted right now. Even when next_state says a transition is warranted, this guard prevents:

  • flap within MIN_DWELL_HOURS of the last transition
  • downward transitions for pinned skills below their pinned tier
  • hysteresis bounce around exact thresholds