template<typename Type, typename ParametersType>
CG_Gen::GeneticGenerator class

GeneticGenerator Template class for generating genetic populations.

Template parameters
Type Type of chromosome in a genetic population
ParametersType Type of parameters used to generate genetics

Constructors, destructors, conversion operators

GeneticGenerator(const ParametersType& i_parameters, std::pair<int32_t, int32_t> i_inout, const std::string& i_mainPath, const std::string& i_name)

Public functions

auto generate() -> std::vector<ChromosomeType<Type, ParametersType>>
generate Generates a genetic population and carries out evolutionary processes The method creates an initial population, calculates the value of the process end function, and in a cycle performs the operations of recombination, mutation and selection until reaching criterion for completing a process or reaching the maximum number of cycles.
auto getGraphsFromPopulation(const std::vector<ChromosomeType<Type, ParametersType>>& i_population) -> std::vector<GraphPtr>

Function documentation

template<typename Type, typename ParametersType>
std::vector<ChromosomeType<Type, ParametersType>> CG_Gen::GeneticGenerator<Type, ParametersType>::generate()

generate Generates a genetic population and carries out evolutionary processes The method creates an initial population, calculates the value of the process end function, and in a cycle performs the operations of recombination, mutation and selection until reaching criterion for completing a process or reaching the maximum number of cycles.

Returns Final genetic population

On each iteration preserves the population. Upon completion, returns the final population.