📄 sa.h
字号:
#ifndef SA_TSP_LiuYongJin_2008_03_20_CSD_XMU
#define SA_TSP_LiuYongJin_2008_03_20_CSD_XMU
typedef struct _path
{
double Length;
int *Citys;
}Path;
typedef struct _posi
{
int x, y;
}Position;
//模拟退火算法
class CSaTsp
{
public:
CSaTsp(char *datafile);
~CSaTsp();
int GetNumCitys();
Position *GetPosition();
void GetBestPath(Path *path);
private:
int m_nCity; //城市个数
Position *m_xyPosition; //每个城市的坐标
Path *m_curPath, *m_newPath, *m_globalPath;
void Init();
double NewPath();
void UpdateBestPath();
double m_Temperature;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -