[−][src]Struct maver::Genetic
Methods
impl Genetic
[src]
pub fn new(
population_size: usize,
network_init: &[usize],
act_in: Activation,
act_out: Activation
) -> Genetic
[src]
population_size: usize,
network_init: &[usize],
act_in: Activation,
act_out: Activation
) -> Genetic
Create new genetic algorithm implementation
population_size
: count of organisms in one generation
network_init
: network topology
act_in:
: activation function for hidden perceptrons
act_out
: activation function for output perceptrons
pub fn advanced_evaluation(&mut self, fun: impl FnMut(&mut [Organism]))
[src]
Advanced evaluation function:
let mut g = Genetic::new(...); g.advanced_evaluation(|organisms: &mut [Organism]| { // write code there });
pub fn evaluate(&mut self, env: &mut dyn Environment)
[src]
Evaluate current population in env
. This code will evaluate organisms in parallel,if you want to evaluate without parallelism use advanced_evaluation
function
pub fn get_champion(&self) -> &Organism
[src]
Get organism with best fitness in current population
pub fn fittest(&self) -> [usize; 2]
[src]
Returns indexes of fittest organisms
pub fn evolve(&mut self, learn_params: &LearnParams)
[src]
Create offspring by mutation and mating.
Auto Trait Implementations
impl Send for Genetic
impl Unpin for Genetic
impl Sync for Genetic
impl UnwindSafe for Genetic
impl RefUnwindSafe for Genetic
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,