pub struct SearchPlan { /* private fields */ }Expand description
A search spec checked against a model, with its space resolved.
Implementations§
Source§impl SearchPlan
impl SearchPlan
Sourcepub fn new(
spec: &SweepSpec,
schema: &ModelSchema<'_>,
) -> Result<Self, SearchPlanError>
pub fn new( spec: &SweepSpec, schema: &ModelSchema<'_>, ) -> Result<Self, SearchPlanError>
Checks the search of spec against schema, and resolves its space.
§Errors
Returns SearchPlanError for a spec with no search or with blocks, search settings or a space that the search
rejects, fixed values or actions that the model rejects, a batch of more than MAX_RUNS runs, or a budget
whose runs overflow a 64-bit count.
Sourcepub fn base(&self) -> &Arc<Plan> ⓘ
pub fn base(&self) -> &Arc<Plan> ⓘ
Plan of the spec’s fixed values and actions. Every candidate starts from the plan’s one config.
Sourcepub fn search(&self) -> &SearchSpec
pub fn search(&self) -> &SearchSpec
Search settings of the spec.
Sourcepub fn space(&self) -> &SearchSpace
pub fn space(&self) -> &SearchSpace
Space of the search, resolved against the model.
Sourcepub fn search_hash(&self) -> u64
pub fn search_hash(&self) -> u64
Hash of every setting that fixes the search’s trajectory, from search_hash.
Sourcepub fn run_count(&self) -> u64
pub fn run_count(&self) -> u64
Number of runs in the whole budget, every evaluation times the replicates.
Sourcepub fn replicates(&self) -> u64
pub fn replicates(&self) -> u64
Number of runs of each evaluation.
Sourcepub fn config(&self, genome: &Genome) -> Config
pub fn config(&self, genome: &Genome) -> Config
Returns the config genome decodes to, over the spec’s fixed values and actions.
§Panics
Panics when genome and the space have different gene counts.
Sourcepub fn run(&self, candidate: &Candidate, index: u64) -> PlannedRun
pub fn run(&self, candidate: &Candidate, index: u64) -> PlannedRun
Returns run index of candidate, counting from 0.
Under independent seeds, a re-evaluation draws from the seeds of the candidate it repeats.
Sourcepub fn run_key(&self, run: &PlannedRun, config: &Config) -> u64
pub fn run_key(&self, run: &PlannedRun, config: &Config) -> u64
Returns the key that identifies the results of run, a run of a candidate whose config is config.
Sourcepub fn replay(&self, run: &PlannedRun, config: &Config) -> Replay
pub fn replay(&self, run: &PlannedRun, config: &Config) -> Replay
Returns the Replay of run, a run of a candidate whose config is config.
Sourcepub fn watched_reducers(
&self,
measure: &MeasurePlan,
) -> Result<Vec<usize>, SearchPlanError>
pub fn watched_reducers( &self, measure: &MeasurePlan, ) -> Result<Vec<usize>, SearchPlanError>
Returns the position of each watched column among the reducer columns of measure.
§Errors
Returns SearchPlanError::UnknownColumn for a watched column that no reducer writes.
Sourcepub fn outline(&self) -> SearchOutline
pub fn outline(&self) -> SearchOutline
Returns the budget, objective and space of the search.
Trait Implementations§
Source§impl Clone for SearchPlan
impl Clone for SearchPlan
Auto Trait Implementations§
impl Freeze for SearchPlan
impl RefUnwindSafe for SearchPlan
impl Send for SearchPlan
impl Sync for SearchPlan
impl Unpin for SearchPlan
impl UnsafeUnpin for SearchPlan
impl UnwindSafe for SearchPlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more