📄 population.h
字号:
//// population.h - Used for the Genetic Grouping Algorithm//// author: J.I.v.Hemert// last updated : 07-11-1997//// This file contains the class PopulationC.//#ifndef POPULATION_H#define POPULATION_H#include <MLCG.h>#include <fstream.h>#include "genotype.h"#define MAXPOPSIZE 500typedef struct GaParamsT{ int PopulationSize; int N_Crossover; int N_Mutation; int N_Inversion; double AllelMutationProb;};class PopulationC{ public: void Initialize (GaParamsT gaparameters, int nrofobjects, bool debugactive, int k_coloring, ColoringT coloringalgorithm); void Evaluate (); void Reproduce (); void PrintBest (ofstream & output); void PrintBest (); void PrintPop (); double GetBestFitness (); double GetColorsUsed (); double GetTotalEvaluations (); private: GenotypeC population[MAXPOPSIZE]; GaParamsT gaparams; bool debug; double totalfitness; int bestindex; double totalevaluations; void PlayTwoTournament (); void ApplyCrossover (); void ApplyMutation (); void ApplyInversion ();};#endif// eof population.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -