Skip to main content

record

Function record 

pub fn record(
    view: &mut StudyView,
    schema: &SpaceSchema,
    number: u64,
    params: Assignment,
    state: TrialState,
    value: Option<f64>,
)
Expand description

Folds one trial’s outcome into view, in the state a sampler should see it.

  • TrialState::Complete with value = Some(v) — a finished observation the sampler learns from (StudyView::visible).
  • TrialState::Running with value = None — an in-flight trial, so a parallel-repulsion sampler (TPE’s constant liar) can see it as pending.
  • TrialState::Failed with value = None — an unevaluable trial, invisible to the sampler but recorded.

The distributions are copied from schema so the recorded trial carries the support each value was drawn from, exactly as storage would.