Struct abc::Candidate [] [src]

pub struct Candidate<S: Clone + Send + Sync + 'static> {
    pub solution: S,
    pub fitness: f64,
}

One solution being explored by the hive, plus additional data.

This implementation was written with the expectation that the evaluate_fitness method may be very expensive, so the Candidate struct caches the computed fitness of its solution.

Fields

solution

Actual candidate solution.

fitness

Cached fitness of the solution.

Methods

impl<S: Clone + Send + Sync + 'static> Candidate<S>

fn new(solution: S, fitness: f64) -> Candidate<S>

Wrap a solution with its cached fitness.

Trait Implementations

impl<S: Clone + Send + Sync + 'static> Debug for Candidate<S> where S: Debug

fn fmt(&self, f: &mut Formatter) -> FmtResult

Derived Implementations

impl<S: Clone + Clone + Send + Sync + 'static> Clone for Candidate<S>

fn clone(&self) -> Candidate<S>

fn clone_from(&mut self, source: &Self)1.0.0