pub struct Candidate<S: Clone + Send + Sync + 'static> {
pub solution: S,
pub fitness: f64,
}
Expand description
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: S
Actual candidate solution.
fitness: f64
Cached fitness of the solution.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Candidate<S>where
S: Freeze,
impl<S> RefUnwindSafe for Candidate<S>where
S: RefUnwindSafe,
impl<S> Send for Candidate<S>
impl<S> Sync for Candidate<S>
impl<S> Unpin for Candidate<S>where
S: Unpin,
impl<S> UnwindSafe for Candidate<S>where
S: 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