pub struct VoiSampler { /* private fields */ }Expand description
VOI-driven sampler with Beta-Bernoulli posterior and e-process control.
Implementations§
Source§impl VoiSampler
impl VoiSampler
Sourcepub fn new_at(config: VoiConfig, now: Instant) -> Self
pub fn new_at(config: VoiConfig, now: Instant) -> Self
Create a new VOI sampler at a specific time (for deterministic tests).
Sourcepub fn posterior_params(&self) -> (f64, f64)
pub fn posterior_params(&self) -> (f64, f64)
Current posterior parameters (alpha, beta).
Sourcepub fn posterior_mean(&self) -> f64
pub fn posterior_mean(&self) -> f64
Current posterior mean.
Sourcepub fn posterior_variance(&self) -> f64
pub fn posterior_variance(&self) -> f64
Current posterior variance.
Sourcepub fn expected_variance_after(&self) -> f64
pub fn expected_variance_after(&self) -> f64
Expected posterior variance after one additional sample.
Sourcepub fn last_decision(&self) -> Option<&VoiDecision>
pub fn last_decision(&self) -> Option<&VoiDecision>
Most recent decision, if any.
Sourcepub fn last_observation(&self) -> Option<&VoiObservation>
pub fn last_observation(&self) -> Option<&VoiObservation>
Most recent observation, if any.
Sourcepub fn decide(&mut self, now: Instant) -> VoiDecision
pub fn decide(&mut self, now: Instant) -> VoiDecision
Decide whether to sample at time now.
Sourcepub fn observe_at(&mut self, violated: bool, now: Instant) -> VoiObservation
pub fn observe_at(&mut self, violated: bool, now: Instant) -> VoiObservation
Record a sampled observation at time now.
Sourcepub fn observe(&mut self, violated: bool) -> VoiObservation
pub fn observe(&mut self, violated: bool) -> VoiObservation
Record a sampled observation using Instant::now().
Sourcepub fn summary(&self) -> VoiSummary
pub fn summary(&self) -> VoiSummary
Current summary statistics.
Sourcepub fn logs(&self) -> &VecDeque<VoiLogEntry>
pub fn logs(&self) -> &VecDeque<VoiLogEntry>
Access current logs.
Sourcepub fn logs_to_jsonl(&self) -> String
pub fn logs_to_jsonl(&self) -> String
Render logs as JSONL.
Sourcepub fn snapshot(&self, max_logs: usize, captured_ms: u64) -> VoiSamplerSnapshot
pub fn snapshot(&self, max_logs: usize, captured_ms: u64) -> VoiSamplerSnapshot
Create a snapshot of the sampler state for debug overlays.
Sourcepub fn mark_forced_sample(&mut self)
pub fn mark_forced_sample(&mut self)
Increment forced sample counter (for testing/integration).
Trait Implementations§
Source§impl Clone for VoiSampler
impl Clone for VoiSampler
Source§fn clone(&self) -> VoiSampler
fn clone(&self) -> VoiSampler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VoiSampler
impl RefUnwindSafe for VoiSampler
impl Send for VoiSampler
impl Sync for VoiSampler
impl Unpin for VoiSampler
impl UnsafeUnpin for VoiSampler
impl UnwindSafe for VoiSampler
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