pub enum CandidateOrigin {
Random,
Restart,
Neighbor {
parent_id: u64,
},
Mutation {
parent_id: u64,
},
Crossover {
first_parent_id: u64,
second_parent_id: u64,
},
Reevaluation {
candidate_id: u64,
},
}Expand description
Source of a candidate’s genome.
Variants§
Random
Drawn uniformly from the space.
Restart
Drawn uniformly from the space when a hill climb starts over.
Neighbor
A step away from hill climb incumbent parent_id.
Mutation
Candidate parent_id with some genes changed.
Crossover
Genes taken from two parents, then mutated.
Fields
Reevaluation
More replicates of candidate candidate_id.
Implementations§
Source§impl CandidateOrigin
impl CandidateOrigin
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Returns the origin’s name in evaluations.csv, as in crossover.
Sourcepub fn parent_ids(self) -> [Option<u64>; 2]
pub fn parent_ids(self) -> [Option<u64>; 2]
Returns the ids of the parents the genome was bred from, the first parent first.
A re-evaluation has no parents. Self::reevaluated_id returns the id of the candidate it repeats.
Sourcepub fn reevaluated_id(self) -> Option<u64>
pub fn reevaluated_id(self) -> Option<u64>
Returns the candidate a re-evaluation adds replicates to, or None for any other origin.
Trait Implementations§
Source§impl Clone for CandidateOrigin
impl Clone for CandidateOrigin
impl Copy for CandidateOrigin
Source§impl Debug for CandidateOrigin
impl Debug for CandidateOrigin
impl Eq for CandidateOrigin
Source§impl PartialEq for CandidateOrigin
impl PartialEq for CandidateOrigin
impl StructuralPartialEq for CandidateOrigin
Auto Trait Implementations§
impl Freeze for CandidateOrigin
impl RefUnwindSafe for CandidateOrigin
impl Send for CandidateOrigin
impl Sync for CandidateOrigin
impl Unpin for CandidateOrigin
impl UnsafeUnpin for CandidateOrigin
impl UnwindSafe for CandidateOrigin
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