📄 readme-gs.cc
字号:
//1.-------------------------------------------------------------------Individual *Genetic_Algorithm::selection(Population &solutions){ Individual *next_generation;#ifdef DEBUG (void)fprintf(logFile, "gs.cc/Individual *Genetic_Algorithm::selection(Population &solutions)\n");#endif /* DEBUG */ next_generation = new Individual[solutions.num_individuals()]; //分配自由存储区内存,但没有施放 delete next_generation set_worst(solutions); switch(s_mode) { case Proportional: selection_proportional(solutions, next_generation); break; case Tournament: selection_tournament(solutions, next_generation); break; case Boltzmann: (void)fprintf(logFile,"gs.cc/Unimplemented Selection Method - using proportional\n"); selection_proportional(solutions, next_generation); break; default: (void)fprintf(logFile,"gs.cc/Unknown Selection Mode!\n"); } return(next_generation);}//end 1.------------------------------------------------------------------------------------------//----------------------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -