gareplaceelitismparams.h
来自「遗传算法做的排课系统」· C头文件 代码 · 共 52 行
H
52 行
#ifndef __GA_REPLACE_ELITISM_PARAMS__
#define __GA_REPLACE_ELITISM_PARAMS__
#include "..\GaReplacement.h"
using namespace Population;
namespace Population
{
namespace ReplacementOperations
{
// Parameters for replacement methods which can remove the best chromosomes from population
class GaReplaceElitismParams : public GaReplacementParams
{
private:
// Number of the best chromosome which will certainly surivive to tje next generation
int _elitism;
public:
// Initialization of the parameters
DLL_EXPORT
GaReplaceElitismParams(int replacementSize,
int elitism);
// Initialization of the parameters with default values
DLL_EXPORT
GaReplaceElitismParams();
// Virtual copy constructor
DLL_EXPORT
virtual GaParameters* GACALL Clone() const;
// Returns number of the best chromosome which will certainly surivive to the next generation
DLL_EXPORT
int GACALL GetElitism() const;
// Sets number of the best chromosome which will certainly surivive to the next generation
DLL_EXPORT
void GACALL SetElitism(int elitism);
};// END CLASS DEFINITION GaReplaceElitismParams
} // ReplacementOperations
} // Population
#endif // __GA_REPLACE_ELITISM_PARAMS__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?