pub struct EdaParams<MP> {
pub pop_size: usize,
pub selection_ratio: f32,
pub bounds: Option<Bounds>,
pub model: MP,
}Expand description
Static configuration for an EdaStrategy run.
All fields are public so callers can use struct-literal construction or
update syntax. The only runtime contract enforced at call time is that
selection_ratio lies strictly in (0, 1) (checked by a
debug_assert! in EdaStrategy::init).
Fields§
§pop_size: usizeNumber of individuals sampled per generation.
selection_ratio: f32Fraction of the population kept by truncation selection; must lie
strictly in (0, 1). The effective k is
ceil(selection_ratio · pop_size) clamped to [2, pop_size].
bounds: Option<Bounds>Optional inclusive [lo, hi] clamp applied to each gene after
sampling. A no-op for binary models (UnivariateBernoulli,
CompactGenetic) whose genes are already {0, 1}.
model: MPModel-specific parameters (includes genome_dim).
Trait Implementations§
Source§impl<MP> Validate for EdaParams<MP>
Validation covers the engine-level knobs shared by every EDA model:
pop_size >= 2 and selection_ratio ∈ (0, 1) (open on both ends, since a
ratio of 0 selects no parents and 1 defeats truncation). Model-specific
params MP (which carry their own genome_dim etc.) are left to the model’s
own fit; no MP: Validate bound is imposed, keeping EdaParams usable
with any model.
impl<MP> Validate for EdaParams<MP>
Validation covers the engine-level knobs shared by every EDA model:
pop_size >= 2 and selection_ratio ∈ (0, 1) (open on both ends, since a
ratio of 0 selects no parents and 1 defeats truncation). Model-specific
params MP (which carry their own genome_dim etc.) are left to the model’s
own fit; no MP: Validate bound is imposed, keeping EdaParams usable
with any model.
Source§fn validate_all(&self) -> Result<(), Vec<ConfigError>>
fn validate_all(&self) -> Result<(), Vec<ConfigError>>
Auto Trait Implementations§
impl<MP> Freeze for EdaParams<MP>where
MP: Freeze,
impl<MP> RefUnwindSafe for EdaParams<MP>where
MP: RefUnwindSafe,
impl<MP> Send for EdaParams<MP>where
MP: Send,
impl<MP> Sync for EdaParams<MP>where
MP: Sync,
impl<MP> Unpin for EdaParams<MP>where
MP: Unpin,
impl<MP> UnsafeUnpin for EdaParams<MP>where
MP: UnsafeUnpin,
impl<MP> UnwindSafe for EdaParams<MP>where
MP: UnwindSafe,
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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