class TPopulation{ // 群体类定义 public: int size; // Size of population: n int lchrom; // Length of chromosome: l float sumfitness, average; INDIVIDUAL *fmin, *fmax; INDIVIDUAL *pop;
class TSGA : public TPopulation{ // TSGA类派生于群体类 public: float pcross; // Probability of Crossover float pmutation; // Probability of Mutation int gen; // Counter of generation