gaselectrandombest.h

来自「遗传算法做的排课系统」· C头文件 代码 · 共 55 行

H
55
字号

#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 + =
减小字号Ctrl + -
显示快捷键?