pub struct CrossoverConfig {
pub n_pairs: usize,
pub swap_probability: f64,
}Expand description
Configuration of the generic crossover population kernel
(SharedSiteCrossover) that EvolutionSMC::run and
EvolutionSMC::anneal build from EvoSmcConfig::crossover.
The kernel swaps a random subset of the addresses shared by both
parents (same address, same value type; each joins the swap
independently with probability swap_probability) and re-scores both
children strictly, rejecting any proposal whose children are not complete
executions over their own pre-swap address sets. That makes it safe on
every prior, including variable-structure ones (grammar trees,
variable-length genomes): it cannot panic and it never accepts a
structurally inconsistent child. The price is that on a variable-structure
prior only structure-preserving swaps are ever accepted — constants,
variable indices, same-arity function choices — because exchanging a
structural site (a #leaf flag, an arity-changing #func) opens a branch
the child has no choices for. Subtree grafts need the model-aware
subtree_crossover_mask driven
through EvolutionSMC::run_with_kernel /
EvolutionSMC::anneal_with_kernel. On a fixed-structure prior (every
vector prior in super::prior) the shared set is the whole address set
and the kernel is exactly fugue’s [fugue::CrossoverKernel].
Fields§
§n_pairs: usizeNumber of (pair, swap) proposals per sweep.
swap_probability: f64Per-address probability that a shared site joins the swap mask.
Trait Implementations§
Source§impl Clone for CrossoverConfig
impl Clone for CrossoverConfig
Source§fn clone(&self) -> CrossoverConfig
fn clone(&self) -> CrossoverConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CrossoverConfig
impl Debug for CrossoverConfig
Source§impl Default for CrossoverConfig
impl Default for CrossoverConfig
Source§fn from(cfg: &CrossoverConfig) -> Self
fn from(cfg: &CrossoverConfig) -> Self
Auto Trait Implementations§
impl Freeze for CrossoverConfig
impl RefUnwindSafe for CrossoverConfig
impl Send for CrossoverConfig
impl Sync for CrossoverConfig
impl Unpin for CrossoverConfig
impl UnsafeUnpin for CrossoverConfig
impl UnwindSafe for CrossoverConfig
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.