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

📄 global.h

📁 用遗传算法解决旅行商问题 用遗传算法解决旅行商问题
💻 H
字号:
#ifndef H_GLOBAL
#define H_GLOBAL


#include <vector>
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <fstream>
#include "math.h"
#include "time.h"




namespace evo{
	using namespace std;
	
	typedef vector<int> VectorInt;
	typedef VectorInt::iterator viter;
	typedef map<int,int> Mapii;
	typedef Mapii::iterator miter;

	#define CITY_COUNT 9//城市数量
	#define EVOTIMES 1000//迭代次数
	#define NOEVOASST 500//判定没有进化的迹象所需的迭代次数


	class CityLayout;//城市之间距离的封装
	class Individual;//个体
	class Group;//种群
	
	
	extern CityLayout layout;//默认的城市之间距离
	

	typedef vector<Individual> VectorIDV;
	typedef VectorIDV::iterator idviter;
	bool find(const VectorIDV &vectoridv,const Individual& indi);
}
#include "CityLayout.h"
#include "Individual.h"
#include "Group.h"





#endif

⌨️ 快捷键说明

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