MaurycyLiebner / EGenetic

Qt based genetic algoritms library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EGenetic

Qt based genetic algoritms library.

Example

See include/egenetic.h.

EGeneticFunctions<double> funcs;

funcs.fGenerator = []() {
    return 0.01* rand() % 100;
};

funcs.fBreeder = [](const double& s1, const double& s2) {
    return 0.5*(s1 + s2);
};

funcs.fSelector = [](const double& s) {
    return 10000 * (s - 1./3.);
};

funcs.fReceiver = [](const std::vector<double>& ss) {
    // here handle the result
};

funcs.fStopped = []() {
    // here delete the EGenetic<double> instance
};

EGeneticSettings sett;
// set how often to receive results (the lower the value the more often)
sett.fReceiveInc = 100;

const auto g = new EGenetic<double>();
g->start(funcs, sett);
// call g->stop() when you want to stop the calculations

About

Qt based genetic algoritms library.


Languages

Language:C++ 89.6%Language:QMake 7.0%Language:C 3.4%