Skip to main content

run

Function run 

pub fn run(
    scheduler: Arc<dyn Scheduler>,
    curves: &[LabeledCurve],
    direction: Direction,
    final_step: u64,
    seed: u64,
) -> Result<FreezeThawReport>
Expand description

Runs scheduler over curves and records the exact freeze/thaw behaviour.

Builds a single-objective study in direction, one trial per curve, and runs each trial’s objective so that it reports curves[i].value_at(step) at every integer step in 1..=final_step that lies beyond its checkpoint — so a resumed trial continues rather than restarts — recording a checkpoint reference at each step. The scheduler’s Decision::Pause and Command::ResumeTrial are executed by the loop and observed through a RecordingScheduler.

seed is the study seed; it also derives each trial’s independent noise realization (noise_seed), so the whole run is reproducible from it.

§Errors

Anything storage or the loop reports. A paused trial is not an error — the loop records it and carries on.