?? ant.h
字號(hào):
/*
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__ */
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -