[][src]Struct easyneural::simulation::Simulation

pub struct Simulation<'a, T: SimulatingWorld> { /* fields omitted */ }

Main struct that handles the learning logic.

Methods

impl<'a, T: SimulatingWorld> Simulation<'a, T>[src]

pub fn new(
    population_size: usize,
    neurons_per_layer: &[usize],
    randomizer: &'a mut dyn RandomProvider,
    mutation_probability: Option<f64>
) -> Result<Simulation<'a, T>, String>
[src]

Creates new simulation struct.

mutation_probability is represented as float number from range [0.0, 1.0).

pub fn run_with_parents(
    &mut self,
    finish: Finish,
    parents: [Specimen; 2]
) -> Result<[Specimen; 2], String>
[src]

Runs the learning round by using the specified specimen as parents for new generation.

Use this function if you already have some trained networks (represented by Specimen) and would like to use them as a base for further learning

pub fn run(&mut self, finish: Finish) -> Result<[Specimen; 2], String>[src]

Runs the learning round.

Returns two best specimen from the most recent generation. These specimen might be used to resume training by using run_with_parents.

pub fn get_number_of_iterations(&self) -> usize[src]

Returns number of iterations used in recent learning session.

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Simulation<'a, T>

impl<'a, T> !Send for Simulation<'a, T>

impl<'a, T> !Sync for Simulation<'a, T>

impl<'a, T> Unpin for Simulation<'a, T> where
    T: Unpin

impl<'a, T> !UnwindSafe for Simulation<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,