Samchon Framework for CPP  1.0.0
samchon::library::GAParameters Class Reference

A structure containing parameters of genetic algorithm. More...

#include <GAParameters.hpp>

Collaboration diagram for samchon::library::GAParameters:

Public Member Functions

 GAParameters ()
 
 GAParameters (size_t generation, size_t population, size_t tournament, double mutationRate)
 
void setGeneration (size_t val)
 
void setPopulation (size_t val)
 
void setTournament (size_t val)
 
void setMutationRate (double val)
 
auto getGeneration () const -> size_t
 
auto getPopulation () const -> size_t
 
auto getTournament () const -> size_t
 
auto getMutationRate () const -> double
 
- Public Member Functions inherited from samchon::protocol::Entity<>
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 

Protected Attributes

size_t generation
 A number of generation of evolution. More...
 
size_t population
 A number of population in a generation. More...
 
size_t tournament
 A number of tournament in a selection. More...
 
double mutationRate
 Rate of mutate ocurrence. More...
 

Detailed Description

A structure containing parameters of genetic algorithm.

The number and rate parameters in the structure affects success of evolution of genetic algorithm.

Class Diagram

Library - Genetic Algorithm

Author
Jeongho Nam http://samchon.org

Definition at line 19 of file GAParameters.hpp.

Constructor & Destructor Documentation

samchon::library::GAParameters::GAParameters ( )
inline

Default Constructor.

Definition at line 64 of file GAParameters.hpp.

samchon::library::GAParameters::GAParameters ( size_t  generation,
size_t  population,
size_t  tournament,
double  mutationRate 
)
inline

Construct from members.

Definition at line 72 of file GAParameters.hpp.

References generation, mutationRate, population, and tournament.

Member Function Documentation

void samchon::library::GAParameters::setGeneration ( size_t  val)
inline

Set generation.

Definition at line 95 of file GAParameters.hpp.

void samchon::library::GAParameters::setPopulation ( size_t  val)
inline

Set population.

Definition at line 103 of file GAParameters.hpp.

void samchon::library::GAParameters::setTournament ( size_t  val)
inline

Set tournament.

Definition at line 111 of file GAParameters.hpp.

void samchon::library::GAParameters::setMutationRate ( double  val)
inline

Set mutation rate.

Definition at line 119 of file GAParameters.hpp.

auto samchon::library::GAParameters::getGeneration ( ) const -> size_t
inline

Get generation.

Definition at line 130 of file GAParameters.hpp.

References generation.

auto samchon::library::GAParameters::getPopulation ( ) const -> size_t
inline

Get population.

Definition at line 138 of file GAParameters.hpp.

References population.

auto samchon::library::GAParameters::getTournament ( ) const -> size_t
inline

Get tournament.

Definition at line 146 of file GAParameters.hpp.

References tournament.

auto samchon::library::GAParameters::getMutationRate ( ) const -> double
inline

Get mutation rate.

Definition at line 154 of file GAParameters.hpp.

References mutationRate.

Member Data Documentation

size_t samchon::library::GAParameters::generation
protected

A number of generation of evolution.

Definition at line 29 of file GAParameters.hpp.

Referenced by GAParameters(), and getGeneration().

size_t samchon::library::GAParameters::population
protected

A number of population in a generation.

Definition at line 34 of file GAParameters.hpp.

Referenced by GAParameters(), and getPopulation().

size_t samchon::library::GAParameters::tournament
protected

A number of tournament in a selection.

Definition at line 39 of file GAParameters.hpp.

Referenced by GAParameters(), and getTournament().

double samchon::library::GAParameters::mutationRate
protected

Rate of mutate ocurrence.

A mutation rate determines the percentage of occurence of mutation in a sequence list.

  • Value from 0.0 to 1.0
Note
  • When mutationRate is too high, it is hard to ancitipate studying on genetic algorithm.
  • When mutationRate is too low and initial set of genes(GeneArray) is far away from optimal, the evolution tends to wandering outside of he optimal.

Definition at line 53 of file GAParameters.hpp.

Referenced by GAParameters(), and getMutationRate().


The documentation for this class was generated from the following file: