pub struct CalibrationKnob {
pub path: String,
pub current: KnobValue,
pub bounds: KnobBounds,
pub max_step: f64,
}Expand description
One tunable engine parameter.
Fields§
§path: StringConfig-tree path the knob writes (e.g. "fraud.fraud_rate").
Must match the path the orchestrator’s config-patcher
understands — same format as
crate::enhancement::ConfigPatch::path.
current: KnobValueCurrent value.
bounds: KnobBoundsAllowable bounds.
max_step: f64Maximum step size (numeric magnitude) the loop may propose
per iteration. Patches with |Δ| > max_step are clipped to
±max_step. Use this to prevent the optimizer from making
a giant jump on a single noisy gradient.
Implementations§
Source§impl CalibrationKnob
impl CalibrationKnob
Sourcepub fn new_f64(
path: impl Into<String>,
current: f64,
min: f64,
max: f64,
max_step: f64,
) -> Self
pub fn new_f64( path: impl Into<String>, current: f64, min: f64, max: f64, max_step: f64, ) -> Self
Convenience constructor for an f64 knob.
Sourcepub fn new_usize(
path: impl Into<String>,
current: usize,
min: usize,
max: usize,
max_step: f64,
) -> Self
pub fn new_usize( path: impl Into<String>, current: usize, min: usize, max: usize, max_step: f64, ) -> Self
Convenience constructor for a usize knob.
Sourcepub fn clip(&self, proposed: KnobValue) -> (KnobValue, KnobClipResult)
pub fn clip(&self, proposed: KnobValue) -> (KnobValue, KnobClipResult)
Clip proposed to the knob’s bounds AND step budget.
Returns the final value + a KnobClipResult describing
whether any clipping happened. Does NOT mutate self.
Sourcepub fn apply(&mut self, proposed: KnobValue) -> KnobClipResult
pub fn apply(&mut self, proposed: KnobValue) -> KnobClipResult
Apply a clipped value to the knob (mutates self.current).
Returns the same KnobClipResult Self::clip returns.
Trait Implementations§
Source§impl Clone for CalibrationKnob
impl Clone for CalibrationKnob
Source§fn clone(&self) -> CalibrationKnob
fn clone(&self) -> CalibrationKnob
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CalibrationKnob
impl RefUnwindSafe for CalibrationKnob
impl Send for CalibrationKnob
impl Sync for CalibrationKnob
impl Unpin for CalibrationKnob
impl UnsafeUnpin for CalibrationKnob
impl UnwindSafe for CalibrationKnob
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.