Skip to main content

stabilize

Function stabilize 

Source
pub fn stabilize<State, B, U>(
    initial: State,
    barrier: B,
    updater: U,
    params: &StabilityParameters,
    max_attempts: usize,
) -> Result<StabilizationResult<State, CorrectionDirectionSet, Evidence>>
where State: Clone, B: FnMut(&State) -> AgentBarrierResult, U: FnMut(State, &BarrierResult<CorrectionDirectionSet, Evidence>) -> SrbnResult<State>,
Expand description

Drive the kernel’s [srbn::stabilize] loop over an arbitrary state, with the barrier producing an AgentBarrierResult (mapped to the kernel result).

Returns the kernel’s [srbn::StabilizationResult] so callers can serialize the attempt trace through [srbn_serde] into the ledger.