global.h
来自「用遗传算法解决旅行商问题 用遗传算法解决旅行商问题」· C头文件 代码 · 共 50 行
H
50 行
#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 + =
减小字号Ctrl + -
显示快捷键?