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

📄 particletsp.h

📁 c++语言实现的遗传算法的例子,需要的快下啊
💻 H
字号:
// ParticleTSP.h: interface for the ParticleTSP class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PARTICLETSP_H__A5EACC5B_CC6C_4E07_AA21_B4D55881F363__INCLUDED_)
#define AFX_PARTICLETSP_H__A5EACC5B_CC6C_4E07_AA21_B4D55881F363__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Assistant.h"

class ParticleTSP  
{
public:
	ParticleTSP(int,Rand *);
	void SetLocation(double*);
	void SetIO();
	void SetIOL(double *);
	void SetOS(double);
	void SetSolution(double);
//	void Update(int,double,double,double,particle *);
	double * GetLocation();
	int * * GetSpeed();
	double * GetIOL();//个体最优位置
	double GetOS();
	double GetSolution();
	void SetSpeed(int * *,int);
	int GetSL();
//	static void SetParam(double,double);
	virtual ~ParticleTSP();
private:
//	static double loc_max;
//	static double loc_min;
	void Copy(double *,double *);//把第一个数组拷贝到第二个数组
	int dimension;
	double * location;
	int * * speed;
	double * indiv_optim_loc;
	double optim_solution;
	double solution;
	int length;//插入对序列长度
};

#endif // !defined(AFX_PARTICLETSP_H__A5EACC5B_CC6C_4E07_AA21_B4D55881F363__INCLUDED_)

⌨️ 快捷键说明

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