Enum Decision
#[non_exhaustive]pub enum Decision {
Continue,
Prune,
Pause,
Fork {
parent: TrialId,
mutation: Assignment,
},
Restart {
parent: TrialId,
mutation: Assignment,
mode: RestartMode,
},
}Expand description
What should happen to a trial that just reported.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Continue
Keep going.
Prune
Stop now. The trial’s last intermediate value becomes its objective
value (FrozenTrial::objective_value).
Pause
Suspend, keeping the checkpoint. The trial may be resumed later via
Command::ResumeTrial.
Executed by the study loop, which transitions the
trial to crate::trial::TrialState::Paused — a
resumable, non-terminal state that keeps the trial’s checkpoint
reference — instead of completing, pruning or failing it.
Fork
Start a child of parent with mutated parameters — PBT’s
exploit-and-explore step.
Executed by the study loop. A fork does not stop the
trial that reported it (see stops_the_trial):
the study loop materializes a new trial whose
TrialTemplate carries the parent
reference and whose parameters are the parent’s with mutation applied,
and the child starts from the parent’s checkpoint reference. Only
scalar perturbations are allowed in mutation — a shape/categorical
parameter is resume-blocked because the parent checkpoint would not
load — and one that is not is refused loudly.
Fields
mutation: AssignmentParameters that differ from the parent’s.
Restart
Start a child of parent that restarts rather than continues — the
fresh or shrink-and-perturb variant of Fork.
Executed by the study loop exactly like a fork, and like a fork it does
not stop the reporting trial. The child’s parameters are the parent’s
with mutation applied, and its
TrialCtx::restart carries mode
and a restart seed derived from the study seed and the child’s number.
A RestartMode::Fresh child gets no parent checkpoint and records the
donor only in its lineage, so mutation may change any parameter; a
RestartMode::ShrinkPerturb child starts from the donor’s checkpoint
like a fork, so only scalar perturbations are allowed.
Fields
parent: TrialIdThe donor trial whose configuration (and, for
RestartMode::ShrinkPerturb, checkpoint) the child starts from.
mutation: AssignmentParameters that differ from the donor’s.
mode: RestartModeHow the child restarts.
Implementations§
§impl Decision
impl Decision
pub const fn stops_the_trial(&self) -> bool
pub const fn stops_the_trial(&self) -> bool
true if the trial should stop making progress right now.