📄 tsp.h
字号:
#ifndef _TSP_
#define _TSP_
#include <cmath>
using namespace std;
#include "CProblem.h"
#include "CSolution.h"
struct Location
{
double x,y;
};
class TSP : public CProblem
{
public:
TSP();
virtual double GetResult(vector<CParam> &cs);
CParam RandomNewParam(int iNonFix);
void NewParamSet();
protected:
vector<Location> m_Nodes;
double Distance(Location &p1,Location &p2)
{
double dx = p2.x-p1.x;
double dy = p2.y-p1.y;
return sqrt(dx*dx + dy*dy);
}
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -