pub struct Population {
pub agents: Vec<Agent>,
pub size: usize,
pub topology_mutation_rate: f32,
pub mutation_rate: f32,
pub mutation_effect_sd: f32,
pub generation: usize,
pub population_fitness: f32,
/* private fields */
}Expand description
§Population
- Purpose: Represents a population in the evolutionary algorithm.
Fields§
§agents: Vec<Agent>§size: usize§topology_mutation_rate: f32§mutation_rate: f32§mutation_effect_sd: f32§generation: usize§population_fitness: f32Implementations§
Source§impl Population
impl Population
pub fn new( genome_base: EneCode, population_size: usize, survival_rate: f32, mutation_rate: f32, topology_mutation_rate: f32, ) -> Self
Sourcepub fn evolve_step(&mut self, pop_config: &PopulationConfig)
pub fn evolve_step(&mut self, pop_config: &PopulationConfig)
§evolve_step
- Purpose: Runs a single round of evolution and increments one generation
pub fn update_population_fitness(&mut self)
pub fn report(&self, pop_config: &PopulationConfig)
pub fn write_agent_genome( &self, idx: usize, file_path: PathBuf, ) -> FileResult<()>
Auto Trait Implementations§
impl Freeze for Population
impl RefUnwindSafe for Population
impl Send for Population
impl Sync for Population
impl Unpin for Population
impl UnwindSafe for Population
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.