pub struct CountOnes;
Expand description
placeholder for testing and bootstrapping, not really used in practice
Trait Implementations§
Source§impl Fitness for CountOnes
impl Fitness for CountOnes
type Genotype = Bit
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
fn call_for_state_population<S: StrategyState<Self::Genotype>, C: StrategyConfig>( &mut self, genotype: &Self::Genotype, state: &mut S, config: &C, thread_local: Option<&ThreadLocal<RefCell<Self>>>, )
fn call_for_state_chromosome<S: StrategyState<Self::Genotype>, C: StrategyConfig>( &mut self, genotype: &Self::Genotype, state: &mut S, config: &C, )
Source§fn call_for_population(
&mut self,
population: &mut FitnessPopulation<Self>,
genotype: &Self::Genotype,
thread_local: Option<&ThreadLocal<RefCell<Self>>>,
cache: Option<&FitnessCache>,
)
fn call_for_population( &mut self, population: &mut FitnessPopulation<Self>, genotype: &Self::Genotype, thread_local: Option<&ThreadLocal<RefCell<Self>>>, cache: Option<&FitnessCache>, )
Pass thread_local for external control of fitness state in multithreading
fn call_for_chromosome( &mut self, chromosome: &mut FitnessChromosome<Self>, genotype: &Self::Genotype, cache: Option<&FitnessCache>, )
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
Auto Trait Implementations§
impl Freeze for CountOnes
impl RefUnwindSafe for CountOnes
impl Send for CountOnes
impl Sync for CountOnes
impl Unpin for CountOnes
impl UnwindSafe for CountOnes
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§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