📄 ant.h
字号:
/*
ANT-CYCLE ALGORITHM FOR TSP
File: ant.h
Author: ehui928
Purpose: ant strcuture definition and some functions
Date: 2007-01-18
*/
#ifndef __ANT_H__
#define __ANT_H__
typedef struct
/*
cur: the current city which ant is at
tabu: tabu list ,it also used to record a tour which ant found
allow: contains cities that can be choosed
allow[N+1] initialize to 0;
if city i has been visited , then set allow[i] to 1.
length: length of the tour which current ant found
*/
{
int cur;
int *tabu;
int *allow;
double length;
} Ant;
void initial_ant(Ant *pant);
void destroy_ant(Ant *pant);
double caculate_tour_length(Ant ant);
int choose_next_city(Ant* pant);
void print_ant_tour(Ant ant);
#endif /* __ANT_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -