pub struct DefaultInteractiveFitness<G>where
G: EvolutionaryGenome,{ /* private fields */ }Expand description
Default interactive fitness implementation using a fixed evaluation mode
This provides a simple implementation that delegates all processing to the fitness aggregator. Suitable for most use cases.
Implementations§
Source§impl<G> DefaultInteractiveFitness<G>where
G: EvolutionaryGenome,
impl<G> DefaultInteractiveFitness<G>where
G: EvolutionaryGenome,
Sourcepub fn new(mode: EvaluationMode) -> Self
pub fn new(mode: EvaluationMode) -> Self
Create a new default interactive fitness with the given mode
Sourcepub fn with_batch_size(self, size: usize) -> Self
pub fn with_batch_size(self, size: usize) -> Self
Set the batch size for batch selection mode
Sourcepub fn with_select_count(self, count: usize) -> Self
pub fn with_select_count(self, count: usize) -> Self
Set how many candidates to select in batch selection mode
Trait Implementations§
Source§impl<G> Clone for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome + Clone,
impl<G> Clone for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome + Clone,
Source§fn clone(&self) -> DefaultInteractiveFitness<G>
fn clone(&self) -> DefaultInteractiveFitness<G>
Returns a duplicate 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<G> Debug for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome + Debug,
impl<G> Debug for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome + Debug,
Source§impl<G> Default for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome,
impl<G> Default for DefaultInteractiveFitness<G>where
G: EvolutionaryGenome,
Source§impl<G> InteractiveFitness for DefaultInteractiveFitness<G>
impl<G> InteractiveFitness for DefaultInteractiveFitness<G>
Source§fn evaluation_mode(&self) -> EvaluationMode
fn evaluation_mode(&self) -> EvaluationMode
Get the preferred evaluation mode for this fitness function
Source§fn request_evaluation(
&self,
candidates: &[Candidate<Self::Genome>],
) -> EvaluationRequest<Self::Genome>
fn request_evaluation( &self, candidates: &[Candidate<Self::Genome>], ) -> EvaluationRequest<Self::Genome>
Generate an evaluation request for the given candidates Read more
Source§fn process_response(
&mut self,
response: EvaluationResponse,
aggregator: &mut FitnessAggregator,
) -> Vec<(CandidateId, f64)>
fn process_response( &mut self, response: EvaluationResponse, aggregator: &mut FitnessAggregator, ) -> Vec<(CandidateId, f64)>
Process user response and update fitness estimates Read more
Source§fn on_generation_start(&mut self, _generation: usize, _population_size: usize)
fn on_generation_start(&mut self, _generation: usize, _population_size: usize)
Optional: Called at the start of each generation Read more
Source§fn on_evaluation_skipped(&mut self)
fn on_evaluation_skipped(&mut self)
Optional: Called when an evaluation is skipped Read more
Auto Trait Implementations§
impl<G> Freeze for DefaultInteractiveFitness<G>
impl<G> RefUnwindSafe for DefaultInteractiveFitness<G>where
G: RefUnwindSafe,
impl<G> Send for DefaultInteractiveFitness<G>
impl<G> Sync for DefaultInteractiveFitness<G>
impl<G> Unpin for DefaultInteractiveFitness<G>where
G: Unpin,
impl<G> UnsafeUnpin for DefaultInteractiveFitness<G>
impl<G> UnwindSafe for DefaultInteractiveFitness<G>where
G: 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§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§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.