pub struct Population<G, A>where
G: Gene<G, A>,{
pub individuals: Vec<Phenotype<G, A>>,
pub is_sorted: bool,
}
Fields§
§individuals: Vec<Phenotype<G, A>>
§is_sorted: bool
Implementations§
Source§impl<G, A> Population<G, A>where
G: Gene<G, A>,
impl<G, A> Population<G, A>where
G: Gene<G, A>,
pub fn get(&self, index: usize) -> &Phenotype<G, A>
pub fn get_mut(&mut self, index: usize) -> &mut Phenotype<G, A>
pub fn set(&mut self, index: usize, individual: Phenotype<G, A>)
pub fn iter(&self) -> Iter<'_, Phenotype<G, A>>
pub fn iter_mut(&mut self) -> IterMut<'_, Phenotype<G, A>>
pub fn len(&self) -> usize
pub fn sort_by<F>(&mut self, f: F)
pub fn from_vec(individuals: Vec<Phenotype<G, A>>) -> Self
pub fn from_fn<F>(size: usize, f: F) -> Self
Trait Implementations§
Source§impl<G, A> Clone for Population<G, A>where
G: Gene<G, A>,
impl<G, A> Clone for Population<G, A>where
G: Gene<G, A>,
Source§impl<G, A> Debug for Population<G, A>
impl<G, A> Debug for Population<G, A>
Source§impl<G, A> FromIterator<Phenotype<G, A>> for Population<G, A>where
G: Gene<G, A>,
impl<G, A> FromIterator<Phenotype<G, A>> for Population<G, A>where
G: Gene<G, A>,
Source§impl<G, A> IntoIterator for Population<G, A>where
G: Gene<G, A>,
impl<G, A> IntoIterator for Population<G, A>where
G: Gene<G, A>,
Auto Trait Implementations§
impl<G, A> Freeze for Population<G, A>
impl<G, A> RefUnwindSafe for Population<G, A>where
A: RefUnwindSafe,
G: RefUnwindSafe,
impl<G, A> Send for Population<G, A>
impl<G, A> Sync for Population<G, A>
impl<G, A> Unpin for Population<G, A>
impl<G, A> UnwindSafe for Population<G, A>where
A: UnwindSafe,
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