📄 gaselectrandombest.h
字号:
#ifndef __GA_SELECT_RANDOM_BEST_H__
#define __GA_SELECT_RANDOM_BEST_H__
#include "..\GaSelection.h"
#include "GaSelectDuplicatesParams.h"
using namespace Population;
using namespace Population::SelectionOperations;
namespace Population
{
namespace SelectionOperations
{
// Parameters for random best selection method
class GaSelectRandomBestParams : public GaSelectDuplicatesParams
{
private:
// How many chromosomes are selected using random selection
int _groupSize;
public:
// Initialization of the parameters
DLL_EXPORT
GaSelectRandomBestParams(int selectionSize,
bool duplicates,
int groupSize);
// Initialization of the parameters with default values
DLL_EXPORT
GaSelectRandomBestParams();
// Virtual copy constructor
DLL_EXPORT
virtual GaParameters* GACALL Clone() const;
// Returns how many chromosomes are selected using random selection
DLL_EXPORT
int GACALL GetGroupSize() const;
// Sets how many chromosomes are selected using random selection
DLL_EXPORT
void GACALL SetGroupSize(int size);
};// END CLASS DEFINITION GaSelectRandomBestParams
} // SelectionOperations
} // Population
#endif // __GA_SELECT_RANDOM_BEST_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -