⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commonbase.h

📁 遗传算法vc++语言版源程序,台湾大学编写。
💻 H
字号:
#ifndef _COMMONBASE_
#define _COMMONBASE_
#include <algorithm>
#include <vector>
#include "UOFId.h"
using namespace std;
class UOFSolution;
class PopSolution;

//! Basic Crossover operator class
/*! This is the prototype of the crossover operator in GABaseSolver*/
class Crossover : public UOFId
{
public: 
	//! A function object that actual performs the crossover action
	/*!	This is an abstract function, User must override this function to work.*/
	virtual	int	operator()(PopSolution*, PopSolution*, PopSolution*, PopSolution*) = 0;
};

//! Basic Selection operator class
/*! This is the prototype of the selector operator in GABaseSolver*/
class Selector : public UOFId
{
public:
	//! A function object that actual performs the selection action
	/*!	This is an abstract function, User must override this function to work.*/
	virtual int operator()(vector<PopSolution*>&, vector<PopSolution*>&) = 0;
};

//! Basic Mutator operator class
/*! This is the prototype of the mutator operator in GABaseSolver*/
class Mutator : public UOFId
{
public:
	//! A function object that actual performs the mutation action
	/*!	This is an abstract function, User must override this function to work.*/
	virtual int	operator()(PopSolution*)=0;
};

//! Basic Move operator class
/*! This is the prototype of the move operator in PSOSolver*/
class Move : public UOFId
{
public:
	//! A function object that actual performs the move action
	/*!	This is an abstract function, User must override this function to work.*/
	virtual	int	operator()(PopSolution* bp, PopSolution* p1, double w, double c1, double c2) = 0;
};

//! Basic AssignVal operator class
/*! This is the prototype of the AssignVal operator in BruteSearch*/
class AssignVal : public UOFId
{
public:
	//! A function object that actual performs the value assignment action
	/*!	This is an abstract function, User must override this function to work.*/
	virtual	int	operator()(PopSolution* bp, vector<double> val) = 0;
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -