MutationSuite

Struct MutationSuite 

Source
pub struct MutationSuite {
    pub strategies: Vec<(Box<dyn MutationStrategy>, f32)>,
}
Expand description

A collection of weighted mutation strategies.

This struct allows for combining multiple mutation algorithms into a single operation. The probability of any given strategy being chosen is proportional to its assigned weight.

Fields§

§strategies: Vec<(Box<dyn MutationStrategy>, f32)>

A vector of tuples, each containing a boxed MutationStrategy and its f32 weight.

Implementations§

Source§

impl MutationSuite

Source

pub fn new() -> Self

Creates a new, empty MutationSuite.

Source

pub fn add_strategy<S: MutationStrategy + 'static>( &mut self, strategy: S, weight: f32, )

Adds a new mutation strategy to the suite with a specified weight.

§Type Parameters
  • S: A type that implements MutationStrategy and has a static lifetime.
Source

pub fn mutate(&self, field: &FractalField) -> FractalField

Mutates the given FractalField by selecting and applying one of the strategies.

The selection is random, with the chance of each strategy being picked determined by its weight relative to the total weight of all strategies.

If no strategies are present, it returns a clone of the original field as a fallback.

Trait Implementations§

Source§

impl Default for MutationSuite

Source§

fn default() -> MutationSuite

Returns the “default value” for a type. Read more

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> 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> Resonance for T
where T: Default + 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

A helper method to allow for runtime type checking (downcasting). This is essential for methods like resonance_similarity that need to know the concrete type of the other object.
Source§

fn resonance_score(&self) -> f64

Returns a scalar score representing the object’s intrinsic resonance. Higher scores typically mean more “resonant” or coherent states.
Source§

fn resonance_similarity(&self, _other: &dyn Resonance) -> f64

Compares the resonance of this object with another. Read more
Source§

fn resonance_law(&self) -> ResonanceLaw

Classifies the resonance pattern or law governing this object.
Source§

fn is_resonant_with(&self, other: &dyn Resonance) -> bool

Returns true if the resonance similarity with another object exceeds a threshold.
Source§

fn resonance_signature(&self) -> Option<Vec<f64>>

Optionally returns a numeric signature or fingerprint of the resonance. Useful for entropy engines, machine learning, or transform matching.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V