Struct revonet::settings::EASettings
[−]
[src]
pub struct EASettings { pub rng_seed: u32, pub pop_size: u32, pub param_count: u32, pub gen_count: u32, pub tour_size: u32, pub use_elite: bool, pub x_type: CrossoverOperator, pub x_prob: f32, pub x_alpha: f32, pub mut_type: MutationOperator, pub mut_prob: f32, pub mut_sigma: f32, }
Settings for evolutionary algorithm.
Fields
rng_seed: u32
Seed for RNG.
pop_size: u32
Population size.
param_count: u32
Number of parameters/genes for the problem.
gen_count: u32
Number of generations.
tour_size: u32
tournament size for tournament selection.
use_elite: bool
Flag indicating whether elitism is to be used or not.
If true
then the best individual in current generation is copied to the next generation.
x_type: CrossoverOperator
Type of the crossover.
x_prob: f32
Crossover probability.
x_alpha: f32
Crossover parameter.
mut_type: MutationOperator
Mutation probability.
mut_prob: f32
Mutation probability.
mut_sigma: f32
Mutation parameter.
Methods
impl EASettings
[src]
fn new(pop_size: u32, gen_count: u32, param_count: u32) -> EASettings
Create default settings using some parameters.
The default values are as follows:
* tour_size = 3
* use_elite = true
* x_type = CrossoverOperator::BlxAlpha
* x_prob = 0.7f32
* x_alpha = 0.1f32
* mut_prob = 1f32 / param_count
* mut_sigma = 0.1f32
Arguments:
pop_size
- population size.gen_count
- number of generations.param_count
- number of genes / problem parameters.
fn from_json(filename: &str) -> Self
fn to_json(&self, filename: &str)
Trait Implementations
impl Clone for EASettings
[src]
fn clone(&self) -> EASettings
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