-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.cpp
67 lines (61 loc) · 1.33 KB
/
show.cpp
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "tsp.hpp"
using namespace std;
void ACOTSP::ShowRoads()
{
/// Muestra en pantalla la matriz de ciudades:
cout<<"\nMATRIZ DE CIUDADES:\n";
for (int row = 0; row < cities; row++)
{
for(int column = 0; column < cities; column++)
{
cout<<"["<<roads[row][column]<<"]";
}
cout<<endl;
}
}
void ACOTSP::ShowPheromones()
{
/// Muestra en pantalla la matriz de feromonas:
cout<<"\nMATRIZ DE FEROMONAS:\n";
for (int row = 0; row < cities; row++)
{
for(int column = 0; column < cities; column++)
{
cout<<"["<<roadsPheromone[row][column]<<"]";
}
cout<<endl;
}
}
void ACOTSP::ShowVisibilities()
{
/// Muestra en pantalla la matriz de feromonas:
cout<<"\nMATRIZ DE VISIBILIDADES:\n";
for (int row = 0; row < cities; row++)
{
for(int column = 0; column < cities; column++)
{
cout<<"["<<visibilityRoads[row][column]<<"]";
}
cout<<endl;
}
}
void ACOTSP::ShowPaths()
{
for (int ant = 0; ant < antsAmount; ant++)
{
for (int city = 0; city < cities; city++)
{
cout<<"["<<paths[ant][city]<<"]";
}
cout<<endl;
}
}
void ACOTSP::ShowBest()
{
cout<<"\nMejor recorrido ["<<bestFitness<<"km]:"<<endl;
for (int city = 0; city < cities; city++)
{
cout<<""<<bestPath[city]<<" => ";
}
cout<<""<<bestPath[0]<<";\n\n";
}