pub struct FireflyConfig {
pub pop_size: usize,
pub genome_dim: usize,
pub bounds: Bounds,
pub beta0: f32,
pub gamma: f32,
pub alpha: f32,
}Expand description
Static configuration for FireflyAlgorithm.
Fields§
§pop_size: usizeNumber of fireflies.
genome_dim: usizeGenome dimensionality.
bounds: BoundsSearch-space bounds.
beta0: f32Base attractiveness β₀. Canonical 1.0.
gamma: f32Light-absorption coefficient γ. Canonical 1.0; controls the
range over which fireflies can see each other.
alpha: f32Noise scale for the random walk term. Canonical 0.2.
Implementations§
Source§impl FireflyConfig
impl FireflyConfig
Sourcepub fn default_for(pop_size: usize, genome_dim: usize) -> Self
pub fn default_for(pop_size: usize, genome_dim: usize) -> Self
Default configuration. γ is scaled by the search-space extent
so the exponential decay lands in a useful regime — Yang’s
canonical γ = 1 assumes [0, 1] normalization; for the usual
[−5.12, 5.12] domain, γ ≈ 1 / L² keeps attractiveness
non-vanishing across pairs.
Trait Implementations§
Source§impl Clone for FireflyConfig
impl Clone for FireflyConfig
Source§fn clone(&self) -> FireflyConfig
fn clone(&self) -> FireflyConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FireflyConfig
impl Debug for FireflyConfig
Source§impl Validate for FireflyConfig
impl Validate for FireflyConfig
Source§fn validate_all(&self) -> Result<(), Vec<ConfigError>>
fn validate_all(&self) -> Result<(), Vec<ConfigError>>
Returns every violated invariant rather than just the first. Read more
Auto Trait Implementations§
impl Freeze for FireflyConfig
impl RefUnwindSafe for FireflyConfig
impl Send for FireflyConfig
impl Sync for FireflyConfig
impl Unpin for FireflyConfig
impl UnsafeUnpin for FireflyConfig
impl UnwindSafe for FireflyConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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