[−][src]Struct radiate::engine::population::Population
Population is what facilitates the evolution from a 5000 ft view keeping track of what the generation is doing, marking statistics down from each one, and holding resource sensitive things like datasets as well as making sure that the optimization is moving forward through the stats it keeps (stagnation)
Methods
impl<T, E, P> Population<T, E, P> where
T: Genome<T, E> + Send + Sync + Clone,
E: Envionment + Sized + Send + Sync + Default,
P: Problem<T>,
[src]
T: Genome<T, E> + Send + Sync + Clone,
E: Envionment + Sized + Send + Sync + Default,
P: Problem<T>,
implmenet the population
pub fn new() -> Self
[src]
base population
pub fn train(&mut self) -> Option<(f32, T)> where
T: Genome<T, E> + Clone + Send + Sync + Debug + PartialEq,
P: Send + Sync,
[src]
T: Genome<T, E> + Clone + Send + Sync + Debug + PartialEq,
P: Send + Sync,
Each generation will be trained by a call to this function resulting optimization of the current generation, up to a crossover into the next generation which will be set to the new current generation
pub fn run<F>(&mut self, runner: F) -> Result<(T, E), &'static str> where
F: Fn(&T, f32, i32) -> bool + Sized,
T: Genome<T, E> + Clone + Send + Sync + Debug + PartialEq,
P: Send + Sync,
E: Clone,
[src]
F: Fn(&T, f32, i32) -> bool + Sized,
T: Genome<T, E> + Clone + Send + Sync + Debug + PartialEq,
P: Send + Sync,
E: Clone,
Run the population according to a user defined function, the inputs of which are a borrowed member which is the top member of the current generation, the fitness of that member, and the current number of generations. This function will continue until this function returns a true value
pub fn populate_gen(self, gen: Generation<T, E>) -> Self
[src]
configure all the settings for the population these all have default settings if they are not set /// customly, however you might find those default settings do not satisfy the needs of your problem /// Set the beginning generation of the population by a generion object this can be done in three ways all listed below.
1.) populate_gen - Create a generation object outsize of this scope and give it to the population, return the popuolation back to the caller 2.) populate_base - as long as the popualtion size has already been set and the type T has implemented the base trait fn, this will generate a new base generation 3.) populate_vec - Give the population a vec of type T and generate a new generation from it then return the population back to the caller 4.) populate_clone - Take a base type T and create a population that is made up completely of clones of this type - they will all be the same at least for the first generation, this is useful for algorithms like NEAT give the populate a direct generation object
pub fn populate_base(self) -> Self where
P: Send + Sync,
[src]
P: Send + Sync,
populate the populate with the base implementation of the genome
pub fn populate_vec(self, vals: Vec<T>) -> Self
[src]
given a vec of type T which implements Genome, populate the population
pub fn populate_clone(self, original: T) -> Self where
T: Genome<T, E> + Clone,
[src]
T: Genome<T, E> + Clone,
Given one type T which is a genome, create a population with clones of the original
pub fn constrain(self, environment: E) -> Self
[src]
Give solver settings to the population to evolve the strucutre defined
pub fn size(self, size: i32) -> Self
[src]
Set the size of the population, the population size will default to 100 if this isn't set which could be enough depending on the problem being solved
pub fn dynamic_distance(self, opt: bool) -> Self
[src]
set the dynamic distance bool
pub fn stagnation(self, stag: usize, cleaner: Vec<Genocide>) -> Self
[src]
set the stagnation number of the population
pub fn configure(self, spec: Config) -> Self
[src]
Set a config object to the population, these are arguments related to evolution through speciation, so these are all speciation arguments
pub fn impose(self, prob: P) -> Self
[src]
Impose a problem on the population, in other words, give the population a problem to solve. This will default to an empty problem, meaning the population will not solve anything if this isn't set. This is really the most important arguemnt for the population
pub fn debug(self, d: bool) -> Self
[src]
debug determines what to display to the screen during evolution
pub fn survivor_criteria(self, survive: SurvivalCriteria) -> Self
[src]
give the population a survival cirteria, if none is supplied then it defaults to the fittest genome from each species
pub fn parental_criteria(self, parents: ParentalCriteria) -> Self
[src]
give the population a way to pick the parents, if none is supplied then default to biasedrandom genomes
Auto Trait Implementations
impl<T, E, P> RefUnwindSafe for Population<T, E, P>
impl<T, E, P> Send for Population<T, E, P> where
P: Send + Sync,
P: Send + Sync,
impl<T, E, P> Sync for Population<T, E, P> where
P: Send + Sync,
P: Send + Sync,
impl<T, E, P> Unpin for Population<T, E, P>
impl<T, E, P> UnwindSafe for Population<T, E, P>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Type for T where
T: ?Sized,
[src]
T: ?Sized,
default fn meta(self: *const T) -> <T as Type>::Meta
[src]
default fn data(self: *const T) -> *const ()
[src]
default fn data_mut(self: *mut T) -> *mut ()
[src]
default fn dangling(t: <T as Type>::Meta) -> NonNull<T>
[src]
default fn fatten(thin: *mut (), t: <T as Type>::Meta) -> *mut T
[src]
const METATYPE: MetaType
[src]
type Meta: 'static
fn meta_type(self: *const Self) -> MetaType
[src]
impl<T> Type for T
[src]
const METATYPE: MetaType
[src]
type Meta = Concrete
Type of metadata for type.
fn meta(self: *const T) -> <T as Type>::Meta
[src]
fn data(self: *const T) -> *const ()
[src]
fn data_mut(self: *mut T) -> *mut ()
[src]
fn dangling(_t: <T as Type>::Meta) -> NonNull<T>
[src]
fn fatten(thin: *mut (), _t: <T as Type>::Meta) -> *mut T
[src]
fn meta_type(self: *const Self) -> MetaType
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,