pub struct PatternSpaceSettings {
pub x_axis: PatternAxis,
pub y_axis: PatternAxis,
pub initial_samples: u64,
pub mutation_scale: f64,
pub aggregate: Aggregate,
}Expand description
Settings of a Pattern Space Exploration.
Fields§
§x_axis: PatternAxisAxis over the first watched column.
y_axis: PatternAxisAxis over the second watched column.
initial_samples: u64Number of candidates drawn at random before any candidate is bred from the archive.
mutation_scale: f64Largest step of a mutated gene, as a fraction of its range.
aggregate: AggregateRule that folds the replicates of a candidate into one value per axis.
Implementations§
Source§impl PatternSpaceSettings
impl PatternSpaceSettings
Sourcepub fn new(x_axis: PatternAxis, y_axis: PatternAxis) -> Self
pub fn new(x_axis: PatternAxis, y_axis: PatternAxis) -> Self
Returns settings over x_axis and y_axis, with 64 initial samples, a mutation scale of 0.1 and the median.
Sourcepub fn check(&self) -> Result<(), SearchSpecError>
pub fn check(&self) -> Result<(), SearchSpecError>
Checks both axes, the initial samples and the mutation scale.
§Errors
Returns SearchSpecError::Setting for an axis with no cells, one bound without the other, a bound that is
not finite or a maximum not above the minimum, no initial samples with an automatic range, or a mutation
scale that is not a positive number.
Sourcepub fn has_ranges(&self) -> bool
pub fn has_ranges(&self) -> bool
Returns whether both axes have both bounds.
Sourcepub fn range_sample_count(&self, max_evaluations: u64) -> u64
pub fn range_sample_count(&self, max_evaluations: u64) -> u64
Returns the number of initial samples an automatic range is taken from, under a budget of max_evaluations.
Sourcepub fn batch_count(&self, max_evaluations: u64, batch_size: usize) -> u64
pub fn batch_count(&self, max_evaluations: u64, batch_size: usize) -> u64
Returns the number of batches that an exploration of max_evaluations evaluations runs, each of at most
batch_size candidates.
The initial samples fill their own batches, and so does the first candidate when there are no initial samples.
Sourcepub fn with_automatic_ranges(&self, outputs: &[(f64, f64)]) -> Self
pub fn with_automatic_ranges(&self, outputs: &[(f64, f64)]) -> Self
Returns the settings with each automatic axis given the range that automatic_range computes from outputs.
outputs holds the x and y output of each initial sample that has both outputs. An axis with bounds keeps them.
Sourcepub fn outputs(&self, evaluation: &Evaluation) -> Option<(f64, f64)>
pub fn outputs(&self, evaluation: &Evaluation) -> Option<(f64, f64)>
Returns the outputs of evaluation on the x and y axes, or None when an axis has no finite value.
Each axis folds the finite values of its column with Self::aggregate, leaving failed replicates out.
Sourcepub fn locate(&self, x: f64, y: f64) -> PatternPlacement
pub fn locate(&self, x: f64, y: f64) -> PatternPlacement
Returns the placement of outputs x and y, with no cell while an axis has no range.
Sourcepub fn place(&self, evaluation: &Evaluation) -> Option<PatternPlacement>
pub fn place(&self, evaluation: &Evaluation) -> Option<PatternPlacement>
Returns the placement of the replicates of evaluation, or None when an axis has no finite value.
The outputs are those Self::outputs returns, and the placement has no cell while an axis has no range.