pub struct SearchSpec {
pub algorithm: SearchAlgorithm,
pub max_evaluations: u64,
pub batch_size: usize,
pub objective: Option<Objective>,
pub space: Vec<FactorSpec>,
}Expand description
A search as written, with its space still in the form that a spec uses.
Fields§
§algorithm: SearchAlgorithmSearch method, with its settings.
max_evaluations: u64Maximum number of evaluations, re-evaluations included.
batch_size: usizeMaximum number of candidates that one ask returns.
objective: Option<Objective>Output a random search, hill climb or genetic algorithm scores. A Pattern Space Exploration has no objective.
space: Vec<FactorSpec>Factors the search varies. A range with no step spans every value from its min to its max.
Implementations§
Source§impl SearchSpec
impl SearchSpec
Sourcepub fn check(&self) -> Result<(), SearchSpecError>
pub fn check(&self) -> Result<(), SearchSpecError>
Checks the budget, the batch size, the objective and the settings of the algorithm.
A batch holds at most MAX_CONFIGS candidates, the same limit as the configs of a sweep’s plan.
§Errors
Returns SearchSpecError for no evaluations, a batch size of 0 or past MAX_CONFIGS, a missing objective
for a random search, hill climb or genetic algorithm, an objective given to a Pattern Space Exploration, or a
setting outside its range.
Sourcepub fn watched_columns(&self) -> Vec<&str>
pub fn watched_columns(&self) -> Vec<&str>
Returns the output columns each replicate of an evaluation reports, in the order Evaluation::outputs
holds them.
Sourcepub fn searcher(
&self,
space: &SearchSpace,
root: u64,
) -> Result<Box<dyn Searcher + Send>, SearchSpecError>
pub fn searcher( &self, space: &SearchSpace, root: u64, ) -> Result<Box<dyn Searcher + Send>, SearchSpecError>
Returns a searcher over space, drawing from search_seed of root.
§Errors
Returns SearchSpecError when Self::check rejects the spec.