Skip to main content

PatternSpaceSettings

Struct PatternSpaceSettings 

Source
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: PatternAxis

Axis over the first watched column.

§y_axis: PatternAxis

Axis over the second watched column.

§initial_samples: u64

Number of candidates drawn at random before any candidate is bred from the archive.

§mutation_scale: f64

Largest step of a mutated gene, as a fraction of its range.

§aggregate: Aggregate

Rule that folds the replicates of a candidate into one value per axis.

Implementations§

Source§

impl PatternSpaceSettings

Source

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.

Source

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.

Source

pub fn has_ranges(&self) -> bool

Returns whether both axes have both bounds.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for PatternSpaceSettings

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PatternSpaceSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PatternSpaceSettings

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PatternSpaceSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSync for T
where T: Sync,