Samchon Framework for CPP
1.0.0
|
A structure containing parameters of genetic algorithm. More...
#include <GAParameters.hpp>
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 |
virtual auto | TAG () const -> std::string |
A tag name when represented by XML. More... | |
virtual auto | toXML () const -> std::shared_ptr< library::XML > override |
Get an XML object represents the Entity. More... | |
![]() | |
Entity () | |
Default Constructor. More... | |
virtual void | construct (std::shared_ptr< library::XML >)=0 |
Construct data of the Entity from an XML object. More... | |
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... | |
A structure containing parameters of genetic algorithm.
The number and rate parameters in the structure affects success of evolution of genetic algorithm.
Definition at line 25 of file GAParameters.hpp.
|
inline |
Default Constructor.
Definition at line 70 of file GAParameters.hpp.
|
inline |
Construct from members.
Definition at line 78 of file GAParameters.hpp.
References generation, mutationRate, population, and tournament.
|
inline |
Set generation.
Definition at line 101 of file GAParameters.hpp.
|
inline |
Set population.
Definition at line 109 of file GAParameters.hpp.
|
inline |
Set tournament.
Definition at line 117 of file GAParameters.hpp.
|
inline |
Set mutation rate.
Definition at line 125 of file GAParameters.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
A tag name when represented by XML.
Implements samchon::protocol::Entity.
Definition at line 168 of file GAParameters.hpp.
|
inlineoverridevirtual |
Get an XML object represents the Entity.
Returns an XML object that can represents the Entity containing member variables into properties.
A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.
Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).
Standard Usage | Non-standard usage abusing value |
---|---|
<memberList> <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' /> <member id='master' name='Administartor' birthdate='2011-07-28' /> </memberList> | <member> <id>jhnam88</id> <name>Jeongho+Nam</name> <birthdate>1988-03-11</birthdate> </member> |
Reimplemented from samchon::protocol::Entity.
Definition at line 172 of file GAParameters.hpp.
References samchon::protocol::Entity::toXML().
|
protected |
A number of generation of evolution.
Definition at line 35 of file GAParameters.hpp.
Referenced by GAParameters(), and getGeneration().
|
protected |
A number of population in a generation.
Definition at line 40 of file GAParameters.hpp.
Referenced by GAParameters(), and getPopulation().
|
protected |
A number of tournament in a selection.
Definition at line 45 of file GAParameters.hpp.
Referenced by GAParameters(), and getTournament().
|
protected |
Rate of mutate ocurrence.
A mutation rate determines the percentage of occurence of mutation in a sequence list.
Definition at line 59 of file GAParameters.hpp.
Referenced by GAParameters(), and getMutationRate().