Advertisement
BeneFager

Untitled

Dec 13th, 2022
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. class Darwin
  2. {
  3. public:
  4.     Population activePopulation;
  5.     Darwin();
  6.     ~Darwin();
  7. #pragma region genome methods
  8.  
  9.     std::vector<Gene> InitGenes(int topology);
  10.     std::vector<Gene> LoadGenes(int topology);
  11.     std::vector<Gene> ByMutation(Population source);
  12.     std::vector<Gene> ByCrossover(Population mother, Population father);
  13.  
  14. #pragma endregion
  15.  
  16. #pragma region population methods
  17.  
  18.     void InitPopulation(int popSize);
  19.     Population InitNewPopulation(int popSize);
  20.     void LoadPopulation(int popSize);
  21.     Gene SelectGenome(Population pop);
  22.     void RecalculatePopulationFitness(Population pop); //klar
  23.     void EvolvePopulation(Population elites);
  24. #pragma endregion
  25.  
  26. #pragma region get genomes
  27.  
  28.     Population GetActivePopulation();
  29.     int GetGeneration();
  30.     std::string GetGenerationString(Population pop);
  31.     Gene GetBestGenome(Population pop);
  32.     Gene GetWorstGenome(Population pop);
  33. #pragma endregion
  34.     const int layerGeneCount[4] = { 7, 12, 12, 12 };
  35. private:
  36.     HelperFuncs* hf;
  37.     int generations = 0;
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement