Struct CrowdlessNsga2
pub struct CrowdlessNsga2 { /* private fields */ }Expand description
NSGA-II with crowding distance deleted: the diversity ablation.
See the module documentation for exactly which single piece differs
from Nsga2.
Implementations§
§impl CrowdlessNsga2
impl CrowdlessNsga2
pub fn with_population_size(population_size: usize) -> Result<Self>
pub fn with_population_size(population_size: usize) -> Result<Self>
An ablation with an explicit population size, matching the real sampler’s bounds so a paired comparison can always be configured.
§Errors
Error::InvalidSpace outside
MIN_POPULATION_SIZE ..= MAX_POPULATION_SIZE.
pub const fn population_size(&self) -> usize
pub const fn population_size(&self) -> usize
How many children make one generation.
pub fn generation(&self) -> u64
pub fn generation(&self) -> u64
How many generations have closed.
0 if the state lock is poisoned — an inspection accessor, not a decision
path.
Trait Implementations§
§impl Debug for CrowdlessNsga2
impl Debug for CrowdlessNsga2
§impl Sampler for CrowdlessNsga2
impl Sampler for CrowdlessNsga2
§fn infer_relative_space(&self, study: &StudyView) -> Result<SpaceSchema>
fn infer_relative_space(&self, study: &StudyView) -> Result<SpaceSchema>
§fn sample_relative(
&self,
study: &StudyView,
trial: &TrialMeta,
space: &SpaceSchema,
) -> Result<Assignment>
fn sample_relative( &self, study: &StudyView, trial: &TrialMeta, space: &SpaceSchema, ) -> Result<Assignment>
Breeds one child, exactly as the real sampler does but with a crowding distance of zero everywhere.
§Errors
Error::InvalidSpace if a declared distribution is malformed;
Error::Sampler if the state lock is poisoned.
§fn sample_independent(
&self,
_study: &StudyView,
trial: &TrialMeta,
name: &str,
dist: &Distribution,
) -> Result<ParamValue>
fn sample_independent( &self, _study: &StudyView, trial: &TrialMeta, name: &str, dist: &Distribution, ) -> Result<ParamValue>
The uniform draw for a parameter the relative space did not cover.
§Errors
Error::InvalidSpace if dist is malformed.
§fn after_trial(&self, study: &StudyView, trial: &FrozenTrial) -> Result<()>
fn after_trial(&self, study: &StudyView, trial: &FrozenTrial) -> Result<()>
Admits the finished trial and, once a generation is full, runs survival.
§Errors
Never — a failure here must not fail the trial.
§fn state(&self) -> Result<Option<SamplerState>>
fn state(&self) -> Result<Option<SamplerState>>
§fn reseed(&self, _seed: u64)
fn reseed(&self, _seed: u64)
A no-op, as the real sampler’s: the randomness is keyed on the trial’s sampler seed.
§fn snapshots_space(&self) -> bool
fn snapshots_space(&self) -> bool
Auto Trait Implementations§
impl !Freeze for CrowdlessNsga2
impl RefUnwindSafe for CrowdlessNsga2
impl Send for CrowdlessNsga2
impl Sync for CrowdlessNsga2
impl Unpin for CrowdlessNsga2
impl UnsafeUnpin for CrowdlessNsga2
impl UnwindSafe for CrowdlessNsga2
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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