Skip to content

ZackMisso/GAHeaderLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GAHeaderLibrary

A small header library for quick integration of genetic algorithms into other C++ projects.

Currently Supported GenoType Representations

  • Bitstring representation (BitGeno)
  • real valued representation (FloatGeno)

Currently Supported Selection Techniques

  • Stochastic Universal Sampling

How To Integrate

Implement your GenoType

class YourClass : public Geno
{
    void initializeRandom(pcg32&) {}
    Pheno* generatePhenotype() {}
    Geno* copy() {}
    void mutate(pcg32&, float) {}
    Geno* crossover(Geno*, pcg32&, float) {}
};

Implement your PhenoType

class YourPheno : public Pheno
{
    double evaluateFitness() {}
};

Run the GA

GA<YourGeno, SUS> ga = GA<YourGeno, SUS>();
ga.evolve();
Geno* best = ga.getBestGenInds()[0];

cout << "Best Individual: " << endl;
best->print();
cout << "Best Fitness: " << best->evaluateFitness() << endl;

Authors

  • Zack Misso

About

A small header library for a Genetic Algorithm implementation. For use in some of my future larger projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors