2 #include <samchon/protocol/Entity.hpp> 72 GAParameters(
size_t generation,
size_t population,
size_t tournament,
double mutationRate)
81 virtual void construct(std::shared_ptr<XML> xml)
override 83 generation = xml->getProperty<
size_t>(
"generation");
84 population = xml->getProperty<
size_t>(
"population");
85 tournament = xml->getProperty<
size_t>(
"tournament");
86 mutationRate = xml->getProperty<
double>(
"mutationRate");
162 virtual auto TAG()
const -> std::string
164 return "gaParameters";
166 virtual auto toXML()
const -> std::shared_ptr<library::XML>
override 168 std::shared_ptr<XML> &xml = super::toXML();
169 xml->setProperty(
"generation", generation);
170 xml->setProperty(
"population", population);
171 xml->setProperty(
"tournament", tournament);
172 xml->setProperty(
"mutationRate", mutationRate);
double mutationRate
Rate of mutate ocurrence.
auto getPopulation() const -> size_t
An entity, a standard data class.
void setGeneration(size_t val)
void setPopulation(size_t val)
auto getTournament() const -> size_t
auto getGeneration() const -> size_t
void setMutationRate(double val)
void setTournament(size_t val)
size_t generation
A number of generation of evolution.
size_t tournament
A number of tournament in a selection.
auto getMutationRate() const -> double
GAParameters(size_t generation, size_t population, size_t tournament, double mutationRate)
A structure containing parameters of genetic algorithm.
size_t population
A number of population in a generation.