-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACO.h
43 lines (30 loc) · 865 Bytes
/
ACO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class ACO {
public:
ACO(int nAnts, int nCities,
double alpha, double beta, double q, double ro, double taumax,
int initCity);
virtual ~ACO();
void init();
void connectCITIES(int cityi, int cityj);
void setCITYPOSITION(int city, double x, double y);
void printPHEROMONES();
void printGRAPH();
void printRESULTS();
void optimize(int ITERATIONS);
private:
double distance(int cityi, int cityj);
bool exists(int cityi, int cityc);
bool vizited(int antk, int c);
double PHI(int cityi, int cityj, int antk);
double length(int antk);
int city();
void route(int antk);
int valid(int antk, int iteration);
void updatePHEROMONES();
int NUMBEROFANTS, NUMBEROFCITIES, INITIALCITY;
double ALPHA, BETA, Q, RO, TAUMAX;
double BESTLENGTH;
int *BESTROUTE;
int **GRAPH, **ROUTES;
double **CITIES, **PHEROMONES, **DELTAPHEROMONES, **PROBS;
};