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

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

?? gaalgorithm.h

?? 遺傳算法做的排課系統
?? H
字號:

#ifndef __GA_ALGORITHM_H__
#define __GA_ALGORITHM_H__

#include "..\ExportImport.h"
#include "..\CallConvention.h"
#include "..\Threading\GaThreading.h"
#include "..\Observing\GaObserving.h"
#include "..\Common\GaCatalogue.h"
#include "GaStopCriteria.h"
#include "..\Population\GaPopulation.h"

using namespace Threading;
using namespace Observing;
using namespace Common;
using namespace Population;
using namespace Algorithm;

namespace Algorithm
{
	// Base class for all algorithm parameters
	class GaAlgorithmParams : public GaParameters { }; // END CLASS DEFINITION GaAlgorithmParams

	// Defines possible states of genetic algorithm
	enum GaAlgorithmState
	{
		GAS_UNINITIALIZED = 0x1, 
		GAS_USER_STOPED = 0x2, 
		GAS_CRITERIA_STOPPED = 0x4, 
		GAS_PAUSED = 0x8, 
		GAS_RUNNING = 0x10, 
		/* --- combined states --- */
		GAS_NOT_RUNNING = 0xF, 
		GAS_STOPPED = 0x6
	};

	// Thread types for multithreaded algorithms
	enum GaAlgorithmThreadType
	{
		GATT_CONTROL = 0, 
		GATT_WORK = 1
	};

	// Interface for genetic algorithms
	class GaAlgorithm
	{

	public:

		// Destructor
		virtual ~GaAlgorithm() { };

		// Sends signal to algoritham to start evolution and problem solving.
		// It can be specified if the solving is continued from previosly saved state
		// or evolution can be started from the beginning discharging saved state,
		virtual void GACALL StartSolving(bool continueSolving)=0;

		// Sends signal to algorithm to stop evolution and problem solving.
		// and to discharge current state.
		virtual void GACALL StopSolving()=0;

		// Sends signal to algorithm to temporary stop evolution and problem solving.
		// but to save the current state.
		virtual void GACALL PauseSolving()=0;

		// Every call of BeginParameterChange() must be fallowed by EndParameterChange() call, or deadlock will occure.
		// Should be called before any parameter of any aspect of an algorithm is changed.
		// It will block thread which calls this method until it is save to do the parameter change.
		virtual void GACALL BeginParameterChange()=0;

		// Every call of BeginParameterChange() must be fallowed by EndParameterChange() call, or deadlock will occure.
		// It signals algorithm that paremeter is changed and it can resume of the execution,
		virtual void GACALL EndParameterChange()=0;

		// Returns the pair of operation and parameters which estimates when the algorithm should stop evolution and problem solving.
		virtual const GaStopCriteriaPair& GACALL StopCriteria() const=0;

		// Sets stop criteria and it's parameters
		virtual void GACALL SetStopCriteria(GaStopCriteria* criteria,
			GaStopCriteriaParams* parameters)=0;

		// Set parameters for stop criteria
		virtual void GACALL SetStopCriteriaParams(GaStopCriteriaParams* parameters)=0;

		// Returns current algorithm parameters
		virtual const GaAlgorithmParams& GACALL GetAlgorithmParameters() const=0;

		// Sets new parameters for algorithm
		virtual void GACALL SetAlgorithmParameters(const GaAlgorithmParams& parameters)=0;

		// Retruns statistical information about execution of the algorithm.
		virtual const GaStatistics& GACALL GetAlgorithmStatistics() const=0;

		// Returns referenct to population at given index.
		virtual const GaPopulation& GACALL GetPopulation(int index) const=0;

		// Returns the state of the evolution and problem solving.
		virtual GaAlgorithmState GACALL GetState() const=0;

		// Subscribes algorithm's observer
		virtual void GACALL SubscribeObserver(GaObserver* observer)=0;

		// Subscribes algorithm's observer
		virtual void GACALL UnsubscribeObserver(GaObserver* observer)=0;

	protected:

		// Every BlockParameterChanages() call must be fallowed by ReleaseParameterChanages() call, or deadlock will occure.
		// Should be called when algoritham enters the section in which changing of parameters is not allowed.
		// If at the moment of call to this method another thread called BeginParemeterChangeg() but not yet called EndPrameterChanged(),
		// this call blocks calling  thread until EndParameterChange() call.
		virtual void GACALL BlockParameterChanges()=0;

		// Every BlockParameterChanages() call must be fallowed by ReleaseParameterChanages() call, or deadlock will occure.
		// Should be called when algoritham exits the section in which changing of parameters is not allowed.
		virtual void GACALL ReleaseParameterChanages()=0;

	};// END CLASS DEFINITION GaAlgorithm

	// Implements auxiliary behaviours of an algorithm
	class GaBaseAlgorithm : public GaAlgorithm
	{

	protected:

		// State of the evolution and problem solving.
		GaAlgorithmState _state;

		// Stop ciriteria with parameters
		GaStopCriteriaPair _stopCriteria;

		// Synchronization object for parameter changes
		GaCriticalSection _syncParameterChanges;

		// Synchronization object for state changes
		GaCriticalSection _syncStateChange;

		// Subscribed observer
		GaObserversList _observers;

	public:

		// Initialization of basic features of the algorithm
		DLL_EXPORT
		GaBaseAlgorithm();

		// Sends signal to algoritham to start evolution and problem solving.
		// It can be specified if the solving is continued from previosly saved state
		// or evolution can be started from the beginning discharging saved state,
		DLL_EXPORT
		virtual void GACALL StartSolving(bool continueSolving);

		// Sends signal to algorithm to stop evolution and problem solving.
		// and to discharge current state.
		DLL_EXPORT
		virtual void GACALL StopSolving();

		// Sends signal to algorithm to temporary stop evolution and problem solving.
		// but to save the current state.
		DLL_EXPORT
		virtual void GACALL PauseSolving();

		// Every call of BeginParameterChange() must be fallowed by EndParameterChange() call, or deadlock will occure.
		// Should be called before any parameter of any aspect of an algorithm is changed.
		// It will block thread which calls this method until it is save to do the parameter change.
		DLL_EXPORT
		virtual void GACALL BeginParameterChange();

		// Every call of BeginParameterChange() must be fallowed by EndParameterChange() call, or deadlock will occure.
		// It signals algorithm that paremeter is changed and it can resume of the execution,
		DLL_EXPORT
		virtual void GACALL EndParameterChange();

		// Returns the pair of operation and parameters which estimates when the algorithm should stop evolution and problem solving.
		DLL_EXPORT
		virtual const GaStopCriteriaPair& GACALL StopCriteria() const;

		// Sets stop criteria and it's parameters
		DLL_EXPORT
		virtual void GACALL SetStopCriteria(GaStopCriteria* criteria,
			GaStopCriteriaParams* parameters);

		// Set parameters for stop criteria
		DLL_EXPORT
		virtual void GACALL SetStopCriteriaParams(GaStopCriteriaParams* parameters);

		// Returns the state of the evolution and problem solving.
		DLL_EXPORT
		virtual GaAlgorithmState GACALL GetState() const;

		// Subscribes algorithm's observer
		DLL_EXPORT
		virtual void GACALL SubscribeObserver(GaObserver* observer);

		// Subscribes algorithm's observer
		DLL_EXPORT
		virtual void GACALL UnsubscribeObserver(GaObserver* observer);

	protected:

		// Check to see if stop criteria is reached.
		// if it is reached then sets algorithm state to GAS_CRITERIA_STOPPED and return TRUE.
		DLL_EXPORT
		virtual bool GACALL CheckStopCriteria();

		// Initialize the algorithm
		virtual void GACALL Initialize()=0;

		// Called when user starts the algorithm
		virtual bool GACALL OnStart()=0;

		// Called when user stops the algorithm
		virtual bool GACALL OnStop()=0;

		// Called when user pauses the algorithm
		virtual bool GACALL OnPause()=0;

		// Called when user resumes the paused algorithm
		virtual bool GACALL OnResume()=0;

		// Every BlockParameterChanages() call must be fallowed by ReleaseParameterChanages() call, or deadlock will occure.
		// Should be called when algoritham enters the section in which changing of parameters is not allowed.
		// If at the moment of call to this method another thread called BeginParemeterChangeg() but not yet called EndPrameterChanged(),
		// this call blocks calling  thread until EndParameterChange() call.
		DLL_EXPORT
		virtual void GACALL BlockParameterChanges();

		// Every BlockParameterChanages() call must be fallowed by ReleaseParameterChanages() call, or deadlock will occure.
		// Should be called when algoritham exits the section in which changing of parameters is not allowed.
		DLL_EXPORT
		virtual void GACALL ReleaseParameterChanages();

		// Every BlockStateChange() call must be fallowed by ReleaseStateChange() call, or deadlock will occure.
		// Should be called when algoritham enters the section in which changing of its state is not allowed.
		DLL_EXPORT
		virtual void GACALL BlockStateChange();

		// Every BlockStateChange() call must be fallowed by ReleaseStateChange() call, or deadlock will occure.
		// Should be called when algoritham exits the section in which changing of its state is not allowed.
		DLL_EXPORT
		virtual void GACALL ReleaseStateChange();

	};// END CLASS DEFINITION GaBaseAlgorithm

} // Algorithm

#endif // __GA_ALGORITHM_H__

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久亚洲伦| 国产91精品久久久久久久网曝门 | 欧美一卡二卡三卡| 国产午夜精品一区二区三区四区| 亚洲理论在线观看| 成人午夜视频网站| 日韩一级高清毛片| 亚洲一区免费视频| 91首页免费视频| 日本一区二区成人| 国产一区美女在线| 日韩欧美国产一区二区三区| 亚洲日穴在线视频| 国产美女精品在线| 欧美一区二区三区视频在线| 一区二区不卡在线播放 | 欧美韩日一区二区三区| 免费一级片91| 在线播放/欧美激情| 一区二区三区在线影院| 91在线播放网址| 国产精品免费视频观看| 国产精品原创巨作av| 欧美成人性战久久| 蜜臀av在线播放一区二区三区| 欧美日韩国产首页在线观看| 一二三区精品福利视频| 91色视频在线| 洋洋成人永久网站入口| thepron国产精品| 一色屋精品亚洲香蕉网站| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 色婷婷激情一区二区三区| 亚洲美女淫视频| 91黄视频在线| 亚洲不卡在线观看| 欧美日韩国产综合视频在线观看| 亚洲成人免费视| 欧美一区二区网站| 免费久久99精品国产| 日韩三区在线观看| 麻豆视频观看网址久久| 精品剧情在线观看| 国产91精品精华液一区二区三区| 国产欧美日韩在线看| 成人av电影在线播放| 亚洲美女免费视频| 欧美日韩www| 奇米色一区二区| 久久久不卡网国产精品一区| 国产成人欧美日韩在线电影| 中文字幕一区二区在线观看 | 国产中文字幕一区| 中文成人综合网| 色婷婷av久久久久久久| 亚洲高清免费观看高清完整版在线观看| 欧美日精品一区视频| 美女在线观看视频一区二区| 国产性做久久久久久| 色综合天天在线| 秋霞影院一区二区| 欧美国产国产综合| 欧美剧在线免费观看网站| 精品一区二区影视| 日韩理论电影院| 欧美福利电影网| 国产成人午夜99999| 亚洲国产成人va在线观看天堂| 精品电影一区二区| 日本高清不卡在线观看| 美日韩黄色大片| 一区二区在线观看av| 9191精品国产综合久久久久久| 高清av一区二区| 五月天激情小说综合| 国产精品毛片久久久久久久| 6080日韩午夜伦伦午夜伦| 成人成人成人在线视频| 日本欧美一区二区三区乱码| 国产精品免费免费| 日韩三级在线免费观看| 在线一区二区观看| 国产在线国偷精品免费看| 夜夜揉揉日日人人青青一国产精品| 精品久久久久久无| 欧美伊人久久久久久久久影院| 国产精品伊人色| 欧美aa在线视频| 亚洲国产一区二区三区| 国产精品日产欧美久久久久| 欧美一区二区三区视频免费播放| k8久久久一区二区三区| 国产乱子伦视频一区二区三区 | 亚洲精品自拍动漫在线| 久久久美女毛片 | 91蜜桃在线免费视频| 久久99精品久久久| 亚洲综合一区二区| 亚洲日本丝袜连裤袜办公室| 国产午夜久久久久| 亚洲精品在线观看网站| 7777精品久久久大香线蕉| 在线国产电影不卡| 色综合天天综合给合国产| 成人少妇影院yyyy| 国产在线观看一区二区| 久久精品久久久精品美女| 午夜精品一区二区三区电影天堂 | 久久久国产精品午夜一区ai换脸| 日韩女优毛片在线| 欧美一区二区三区成人| 91精品国产免费久久综合| 欧美网站大全在线观看| 欧洲亚洲精品在线| 欧美专区日韩专区| 色老综合老女人久久久| 91香蕉视频黄| 欧美亚洲综合色| 欧美日韩一区国产| 欧美日免费三级在线| 欧美三片在线视频观看| 欧美美女黄视频| 91精品国产全国免费观看| 9191成人精品久久| 日韩一区二区在线播放| 日韩精品一区二区三区在线 | 国产精品麻豆一区二区| 国产精品蜜臀av| 最新欧美精品一区二区三区| 亚洲精品视频在线观看网站| 一区二区三区免费在线观看| 亚洲第一会所有码转帖| 久久国产麻豆精品| 高清beeg欧美| 在线国产电影不卡| 欧美一区二区女人| 国产日本一区二区| 中文字幕综合网| 日韩电影一区二区三区四区| 六月丁香综合在线视频| 国产成人综合精品三级| 91美女蜜桃在线| 欧美一区二区三区四区五区| 久久久91精品国产一区二区精品 | 亚洲小少妇裸体bbw| 青椒成人免费视频| 成人自拍视频在线观看| 欧美午夜宅男影院| 亚洲精品一区二区三区99| 亚洲色图19p| 另类小说欧美激情| av网站一区二区三区| 欧美乱熟臀69xxxxxx| 26uuu国产日韩综合| 亚洲视频一区二区在线观看| 日韩精品成人一区二区三区| 国产成人鲁色资源国产91色综| 日本高清视频一区二区| 久久午夜老司机| 亚洲一区二区三区在线| 国产精品一区二区无线| 欧美性一二三区| 亚洲国产成人自拍| 亚洲国产aⅴ成人精品无吗| 国产成人夜色高潮福利影视| 欧美日韩国产高清一区| 中文字幕欧美国产| 看电影不卡的网站| 在线观看日产精品| 欧美国产欧美综合| 免费久久精品视频| 欧美羞羞免费网站| 亚洲欧洲成人自拍| 国产在线视视频有精品| 337p亚洲精品色噜噜| 亚洲人123区| 欧美日高清视频| 综合久久给合久久狠狠狠97色| 久久国产精品无码网站| 精品视频在线看| 亚洲精品免费播放| 成人黄色软件下载| 国产网站一区二区| 久久成人麻豆午夜电影| 欧美日本一道本| 亚洲综合av网| 91免费观看视频| 综合av第一页| 成人精品免费看| 国产日韩欧美激情| 国内精品伊人久久久久影院对白| 884aa四虎影成人精品一区| 一区二区三区资源| 97国产精品videossex| 中文字幕免费不卡在线| 久久69国产一区二区蜜臀| 日韩一区和二区| 激情五月婷婷综合| 久久久噜噜噜久噜久久综合| 国产一区二区电影|