Struct genetic_algorithm::fitness::placeholders::SumStaticMatrix
source · pub struct SumStaticMatrix<T, const N: usize, const M: usize>{ /* private fields */ }Expand description
placeholder for testing and bootstrapping, not really used in practice Sums the static matrix rows and converts to vector of FitnessValue There are 2 constructors:
- new(), precision is defaulted to 1.0
- new_with_precision(precision)
Implementations§
source§impl<T, const N: usize, const M: usize> SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> SumStaticMatrix<T, N, M>
pub fn new() -> Self
pub fn new_with_precision(precision: f64) -> Self
Trait Implementations§
source§impl<T, const N: usize, const M: usize> Clone for SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> Clone for SumStaticMatrix<T, N, M>
source§fn clone(&self) -> SumStaticMatrix<T, N, M>
fn clone(&self) -> SumStaticMatrix<T, N, M>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T, const N: usize, const M: usize> Fitness for SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> Fitness for SumStaticMatrix<T, N, M>
type Genotype = StaticMatrix<T, N, M>
source§fn calculate_for_population(
&mut self,
_population: &FitnessPopulation<Self>,
genotype: &Self::Genotype,
) -> Vec<Option<FitnessValue>>
fn calculate_for_population( &mut self, _population: &FitnessPopulation<Self>, genotype: &Self::Genotype, ) -> Vec<Option<FitnessValue>>
Optional interception point for client implementation. Read more
fn call_for_state_population<S: StrategyState<Self::Genotype>>( &mut self, state: &mut S, genotype: &Self::Genotype, thread_local: Option<&ThreadLocal<RefCell<Self>>>, )
fn call_for_state_chromosome<S: StrategyState<Self::Genotype>>( &mut self, state: &mut S, genotype: &Self::Genotype, )
source§fn call_for_population(
&mut self,
population: &mut FitnessPopulation<Self>,
genotype: &Self::Genotype,
thread_local: Option<&ThreadLocal<RefCell<Self>>>,
)
fn call_for_population( &mut self, population: &mut FitnessPopulation<Self>, genotype: &Self::Genotype, thread_local: Option<&ThreadLocal<RefCell<Self>>>, )
Pass thread_local for external control of fitness caching in multithreading
fn call_for_chromosome( &mut self, chromosome: &mut FitnessChromosome<Self>, genotype: &Self::Genotype, )
source§fn calculate_for_chromosome(
&mut self,
_chromosome: &FitnessChromosome<Self>,
_genotype: &Self::Genotype,
) -> Option<FitnessValue>
fn calculate_for_chromosome( &mut self, _chromosome: &FitnessChromosome<Self>, _genotype: &Self::Genotype, ) -> Option<FitnessValue>
Optional interception point for client implementation
Auto Trait Implementations§
impl<T, const N: usize, const M: usize> Freeze for SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> RefUnwindSafe for SumStaticMatrix<T, N, M>where
T: RefUnwindSafe,
impl<T, const N: usize, const M: usize> Send for SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> Sync for SumStaticMatrix<T, N, M>
impl<T, const N: usize, const M: usize> Unpin for SumStaticMatrix<T, N, M>where
T: Unpin,
impl<T, const N: usize, const M: usize> UnwindSafe for SumStaticMatrix<T, N, M>where
T: 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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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