Struct revonet::ea::RealCodedIndividual
[−]
[src]
pub struct RealCodedIndividual { pub genes: Vec<f32>, pub fitness: f32, }
Represents real-coded individual with genes encoded as vector of real numbers.
Fields
genes: Vec<f32>
Collection of individual genes.
fitness: f32
Fitness value associated with the individual.
Trait Implementations
impl Clone for RealCodedIndividual
[src]
fn clone(&self) -> RealCodedIndividual
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for RealCodedIndividual
[src]
impl Individual for RealCodedIndividual
[src]
fn new() -> Self
Creates a new individual with empty set of genes and NAN fitness.
fn init<R: Rng>(&mut self, size: usize, rng: &mut R)
Initializes an individual by allocating random vector of genes using Gaussian distribution. Read more
fn get_fitness(&self) -> f32
Return current fitness value.
fn set_fitness(&mut self, fitness: f32)
Update fitness value.
fn to_vec(&self) -> Option<&[f32]>
Return vector of genes.
fn to_vec_mut(&mut self) -> Option<&mut Vec<f32>>
Return mutable vector of genes.
fn to_net(&mut self) -> Option<&MultilayeredNetwork>
Return MultilayeredNetwork
object with weights assigned according to the genes' values.
fn to_net_mut(&mut self) -> Option<&mut MultilayeredNetwork>
Return mutable MultilayeredNetwork
object with weights assigned according to the genes' values.
fn set_net(&mut self, net: MultilayeredNetwork)
Update individual's MultilayeredNetwork
object and update genes according to the network weights. Read more