[−][src]Struct easyneural::simulation::Simulation
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]
population_size: usize,
neurons_per_layer: &[usize],
randomizer: &'a mut dyn RandomProvider,
mutation_probability: Option<f64>
) -> Result<Simulation<'a, T>, String>
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]
&mut self,
finish: Finish,
parents: [Specimen; 2]
) -> Result<[Specimen; 2], String>
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,
T: Unpin,
impl<'a, T> !UnwindSafe for Simulation<'a, T>
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, 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,