亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gachromosome.h

?? 遺傳算法做的排課系統
?? H
?? 第 1 頁 / 共 2 頁
字號:

#ifndef __GA_CHROMOSOME_H__
#define __GA_CHROMOSOME_H__

#include "..\ExportImport.h"
#include "..\CallConvention.h"
#include "..\Common\GaSmartPtr.h"
#include "..\Common\GaParameters.h"

namespace Population
{
	enum GaSortedGroupType;
	class GaPopulation;
} // Population

using namespace Common;
using namespace Population;

namespace Chromosome
{
	// Parameter for operations which are performed on chromosomes.
	class GaChromosomeParams : public GaParameters
	{

	protected:

		// Probability in percent that mutation will occure.
		float _mutationProbability;

		// Maximum size of chromosome's portion which will be mutated
		int _mutationSize;

		// If it is set to TRUE indicates that the only mutations which lead to improvment of fittness will be commited
		bool _improvingOnlyMutations;

		// Probability in percent that crossover will occure.
		float _crossoverProbability;

		// Number of points on which crossover operation will be performed.
		int _numberOfCrossoverPoints;

	public:

		// Initialize chromosome's parameters
		DLL_EXPORT
		GaChromosomeParams(float mutationProbability,
			int mutationSize,
			bool improvingOnlyMutations,
			float crossoverProbability,
			int numberOfCrossoverPoints);

		// Initialize chromosome's parameters with default values
		DLL_EXPORT
		GaChromosomeParams();

		// Virtual copy constructor
		DLL_EXPORT
		virtual GaParameters* GACALL Clone() const;

		// Sets probability in percent that mutation will occure.
		DLL_EXPORT
		void GACALL SetMutationProbability(float probability);

		// Gets probability in percent that mutation will occure.
		DLL_EXPORT
		float GACALL GetMutationProbability() const;

		// Sets maximum size of chromosome's portion which will be mutated
		DLL_EXPORT
		void GACALL SetMutationSize(int size);

		// Returns maximum size of chromosome's portion which will be mutated
		DLL_EXPORT
		int GetMutationSize() const;

		// If it is set to TRUE indicates that the only mutations which lead to improvment of fittness will be commited
		DLL_EXPORT
		void GACALL SetImprovingMutationsFlag(bool improvingOnly);

		// Returns TRUE if the only mutations which lead to improvment of fitness is commited.
		DLL_EXPORT
		bool GACALL GetImprovingMutationsFlag() const;

		// Sets probability in percent that crossover will occure.
		DLL_EXPORT
		void GACALL SetCrossoverProbability(float probability);

		// Gets probability in percent that crossover will occure.
		DLL_EXPORT
		float GACALL GetCrossoverProbability() const;

		// Sets number of points on which crossover operation will be performed.
		DLL_EXPORT
		void GACALL SetNumberOfCrossoverPoints(int numberOfPoints);

		// Gets number of points on which crossover operation will be performed.
		DLL_EXPORT
		int GACALL GetNumberOfCrossoverPoints() const;

	};// END CLASS DEFINITION GaChromosomeParams

	class GaChromosome;

	// Smart pointers to chromosome
	typedef GaSmartPtr<GaChromosome> GaChromosomePtr;
	typedef GaSmartPtr<const GaChromosome> GaChromosomeConstPtr;

	// Base class for all chromosomes.
	class GaChromosome
	{

	public:

		// Destructor
		virtual ~GaChromosome() { };

		// Performs crossover operation and make new chiled from this and another given chromosome,
		virtual GaChromosomePtr GACALL Crossover(GaChromosomePtr secondParent) const=0;

		// Mutation operation
		virtual void GACALL Mutation()=0;

		// Make new chromosome which is the exact copy of this chromosome
		virtual GaChromosomePtr GACALL MakeCopy(bool setupOnly) const=0;

		// Make new chromosome of this type but with random characteristic
		virtual GaChromosomePtr GACALL MakeNewFromPrototype() const=0;

		// Returns fitness of the chromosome
		virtual float GACALL GetFitness() const=0;

		// Compares fitnesses of two chromosomes. Returns:
		//  a, -1 if the fitness value of this chromosome is lower then the value of the given chromosome
		//  b.  0 if the fitness values of both chromosomes are equal
		//  c.  1 if the fitness value of this chromosome is greater then the value of the given chromosome
		virtual int GACALL CompareFitnesses(GaChromosomePtr c) const=0;

		// Compares fitnesses of two chromosomes. Returns:
		//  a, -1 if the fitness value of this chromosome is lower then the given value
		//  b.  0 if the fitness values of both chromosomes are equal
		//  c.  1 if the fitness value of this chromosome is greater then the given value
		virtual int GACALL CompareFitnesses(float c) const=0;

		// Refresh fitness value of chromosome
		virtual void GACALL RefreshFitness()=0;

		// Returns algorithm's parameters of chromosome
		virtual const GaChromosomeParams& GACALL GetParameters() const=0;

		// Sets algorithm's parameters of chromosome
		virtual void GACALL SetParameters(GaChromosomeParams* p)=0;

		// Returns size of chromosome's code
		virtual int GACALL GetCodeSize() const=0;

		// Copy data and setup from given source chromosome
		virtual GaChromosome& GACALL operator =(const GaChromosome& rhs)=0;

		// Compares two chromosomes and returns how much are they simular in percent
		virtual float GACALL operator ==(const GaChromosome& c) const=0;

	protected:

		// Calculate the fitness of chromosome
		virtual float GACALL CalculateFitness() const=0;

	};// END CLASS DEFINITION GaChromosome

	class GaFitnessComparator;

	// Manages chromosome's scaled fitness value
	class GaScaledChromosome
	{
		DEFINE_SYNC_CLASS

	private:

		// Scaled fitness of the chromsome
		float _scaledFitness;

		// Population in which this chromosome is located
		GaPopulation* _population;

		// Pointer to the chromsome
		GaChromosomePtr _chromosome;

		// Group to which this chromosome belongs
		GaSortedGroupType _groups;

		// Index of chromosome in population
		int _index;

	public:

		// Initialization of scaled value
		DLL_EXPORT
		GaScaledChromosome(GaChromosomePtr chromosome,
			GaPopulation* population,
			int index);

		// Default constructor
		DLL_EXPORT
		GaScaledChromosome(GaPopulation* population);

		// Returns pointer to chromosome
		DLL_EXPORT
		GaChromosomePtr GACALL GetChromosome() const;

		// Sets pointer to chromosome
		DLL_EXPORT
		void GACALL SetChromosome(GaChromosomePtr chromosome);

		// Returns scaled fitness value
		DLL_EXPORT
		float GACALL GetScaledFitness() const;

		// Sets scaled fitness value
		DLL_EXPORT
		void GACALL SetScaledFitness(float fitness);

		// Returns fitness value (scaled or non scaled fitness) for comparation
		DLL_EXPORT
		float GACALL GetFitnessForComparation() const;

		// Rescale scaled fitness value
		DLL_EXPORT
		void GACALL Rescale();

		// Compares fitnesses of two chromosomes. Returns:
		//  a, -1 if the fitness value of this chromosome is lower then the value of the given chromosome
		//  b.  0 if the fitness values of both chromosomes are equal
		//  c.  1 if the fitness value of this chromosome is greater then the value of the given chromosome
		DLL_EXPORT
		int GACALL CompareFitnesses(const GaScaledChromosome& c) const;

		// Compares fitnesses of two chromosomes. Returns:
		//  a, -1 if the fitness value of this chromosome is lower then the given value
		//  b.  0 if the fitness values of both chromosomes are equal
		//  c.  1 if the fitness value of this chromosome is greater then the given value
		DLL_EXPORT
		int GACALL CompareFitnesses(float c) const;

		// Removes chromosome from desired groups
		DLL_EXPORT
		void GACALL ClearGroupFlags(GaSortedGroupType groups);

		// Sets flag that chromosome belongs to specified groups
		DLL_EXPORT
		void GACALL SetGroupFlags(GaSortedGroupType groups);

		// Returns TRUE if the chromosome belongs to specified groups
		DLL_EXPORT
		bool GACALL GetGroupFlag(GaSortedGroupType groups,
			bool all = false);

		// Sets groups to which this chromosome belongs
		DLL_EXPORT
		void GACALL SetGroups(GaSortedGroupType groups);

		// Returns groups to which this chromosome belongs
		DLL_EXPORT
		GaSortedGroupType GACALL GetGroups() const;

		// Sets index of chromosome in pupulation
		DLL_EXPORT
		void GACALL SetIndex(int index);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品欧美日韩精品一 | 久久影院电视剧免费观看| 99精品偷自拍| 懂色av中文一区二区三区| 久久成人免费网| 九一久久久久久| 精一区二区三区| 国产在线精品一区二区| 久草热8精品视频在线观看| 狠狠色丁香婷婷综合久久片| 美腿丝袜在线亚洲一区| 麻豆国产精品777777在线| 久久精品国产久精国产| 精品中文av资源站在线观看| 国产在线播放一区二区三区| 国产成人精品综合在线观看| 成人国产精品免费观看动漫| 99久久er热在这里只有精品15| 色一情一伦一子一伦一区| 日本久久电影网| 9191国产精品| 精品国产亚洲在线| 中文字幕欧美三区| 亚洲精品福利视频网站| 五月激情六月综合| 国产在线视频精品一区| 99亚偷拍自图区亚洲| 欧美偷拍一区二区| 久久综合成人精品亚洲另类欧美 | 国产精品久久久久久久久搜平片| 国产精品免费视频一区| 亚洲精品亚洲人成人网在线播放| 午夜在线成人av| 经典三级在线一区| 94-欧美-setu| 日韩欧美自拍偷拍| 中文字幕一区二区不卡| 日韩福利视频网| 国产成人免费在线观看| 欧美视频一二三区| 欧美激情一区在线| 三级成人在线视频| 成人av在线观| 日韩欧美视频一区| 亚洲已满18点击进入久久| 韩国一区二区三区| 欧美精品在线一区二区三区| 日本一区二区三区dvd视频在线| 亚洲一区二区欧美日韩| 盗摄精品av一区二区三区| 欧美一区二区三区四区五区| 中文字幕亚洲电影| 国产精品一二三区| 欧美精品在线观看播放| 最近日韩中文字幕| 国产成人啪午夜精品网站男同| 91精品国产美女浴室洗澡无遮挡| 最新日韩在线视频| 国产精品一级片| 26uuu亚洲综合色| 五月天激情综合| 色婷婷精品大在线视频| 国产精品久久久久三级| 国产不卡免费视频| 欧美mv日韩mv亚洲| 久久精品免费观看| 欧美一区永久视频免费观看| 亚洲综合999| 色婷婷综合久久久中文一区二区 | 亚洲综合区在线| 成人福利视频在线看| www欧美成人18+| 精品中文字幕一区二区小辣椒 | wwwwxxxxx欧美| 男男成人高潮片免费网站| 欧美久久久久久久久久| 日韩专区一卡二卡| 欧美高清视频在线高清观看mv色露露十八 | 91在线无精精品入口| 国产精品另类一区| 波多野结衣欧美| 国产精品电影一区二区| 成人网男人的天堂| 国产精品麻豆久久久| 99久久久精品| 一区二区三区高清在线| 欧美在线免费观看视频| 亚洲一区在线观看视频| 欧美嫩在线观看| 麻豆一区二区99久久久久| 久久这里只有精品首页| 国产精品亚洲午夜一区二区三区 | 91视频免费观看| 亚洲一区二区视频在线观看| 3d成人h动漫网站入口| 伦理电影国产精品| 亚洲国产精品传媒在线观看| 91一区二区三区在线观看| 亚洲一二三专区| 精品99一区二区三区| 粗大黑人巨茎大战欧美成人| 亚洲免费色视频| 欧美一区二区日韩一区二区| 国内久久婷婷综合| 综合网在线视频| 91麻豆精品国产| 国产福利不卡视频| 亚洲精品高清在线| 日韩免费在线观看| av福利精品导航| 日日夜夜免费精品视频| 国产视频一区在线观看| 色婷婷狠狠综合| 久久国产免费看| 亚洲免费观看高清完整版在线观看| 欧美午夜精品久久久久久孕妇| 国模套图日韩精品一区二区 | 久久成人免费网站| 尤物av一区二区| 精品国产凹凸成av人网站| 99精品视频一区| 久草中文综合在线| 亚洲电影第三页| 国产免费成人在线视频| 7777女厕盗摄久久久| jvid福利写真一区二区三区| 日韩电影在线免费| 伊人一区二区三区| 久久久精品免费网站| 69精品人人人人| 91性感美女视频| 国产成人精品一区二区三区四区 | 中文字幕乱码久久午夜不卡| 欧美日韩国产成人在线免费| 成人精品视频一区二区三区| 美女视频黄 久久| 亚洲18色成人| 亚洲曰韩产成在线| 日韩伦理电影网| 亚洲国产电影在线观看| 国产日韩精品一区二区三区 | 成人天堂资源www在线| 久久精品国产精品青草| 日韩精品一二三区| 亚洲不卡在线观看| 亚洲成人tv网| 亚洲福利电影网| 一区二区三区成人| 最新国产成人在线观看| 中文一区一区三区高中清不卡| 精品久久久久久亚洲综合网| 欧美色偷偷大香| 成人av午夜电影| 不卡欧美aaaaa| 加勒比av一区二区| 日本亚洲三级在线| 久久电影网电视剧免费观看| 亚洲国产成人精品视频| 亚洲天堂久久久久久久| 久久亚洲精品国产精品紫薇| 久久久91精品国产一区二区三区| 67194成人在线观看| 欧美日韩国产综合视频在线观看 | 欧美日韩国产免费一区二区 | www.欧美.com| 国产曰批免费观看久久久| 蜜臀av一区二区在线观看 | 一本色道久久综合狠狠躁的推荐| 成人高清视频在线观看| 国产传媒欧美日韩成人| 国产麻豆日韩欧美久久| 国产老肥熟一区二区三区| 成人一区二区视频| 成人免费观看男女羞羞视频| 国产激情一区二区三区四区 | 欧美日韩国产精品成人| 色综合天天综合在线视频| 99久久综合99久久综合网站| 国产精品456露脸| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲一区av在线| 亚洲午夜免费福利视频| 裸体健美xxxx欧美裸体表演| 另类小说色综合网站| 国产一区二区精品久久| 国产精品99久久久久久似苏梦涵 | 蜜臀a∨国产成人精品| 麻豆成人久久精品二区三区红 | 在线不卡一区二区| 久久久国产综合精品女国产盗摄| 欧美韩日一区二区三区四区| 国产精品久久久久久久久免费相片| 亚洲黄色小说网站| 日韩不卡一二三区| 91亚洲国产成人精品一区二三| 欧美日韩亚洲国产综合| 精品区一区二区| 亚洲欧美福利一区二区| 精品一区二区三区在线播放视频| 国产福利一区在线观看|