Compare commits

2 Commits

Author SHA1 Message Date
Jan Potocki 6cab940785 Fixed newline in output (TS) 2020-01-20 19:24:40 +01:00
Jan Potocki c10d296d82 Fixed TS crash when entire neighborhood is on tabu list 2020-01-20 19:23:47 +01:00
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -517,7 +517,9 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
while(cheeseSupplied == true) while(cheeseSupplied == true)
{ {
std::vector<unsigned> nextRoute; std::vector<unsigned> nextRoute = currentRoute;
// ...na wszelki wypadek, gdyby cale sasiedztwo bylo na liscie tabu
// (zeby algorytm sie nie wywalil)
int nextRouteLength = -1; int nextRouteLength = -1;
std::vector<unsigned> nextTabu(3, 0); std::vector<unsigned> nextTabu(3, 0);
@@ -691,6 +693,4 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
// Reset licznika iteracji przed restartem // Reset licznika iteracji przed restartem
stopCounter = 0; stopCounter = 0;
} }
std::cout << std::endl;
} }
+1
View File
@@ -448,6 +448,7 @@ int main(int argc, char *argv[])
cout << route.at(i) << '\t' << length << '\t' << distFromStart << endl; cout << route.at(i) << '\t' << length << '\t' << distFromStart << endl;
} }
cout << endl;
cout << "Dlugosc trasy: " << distFromStart << endl; cout << "Dlugosc trasy: " << distFromStart << endl;
cout << endl; cout << endl;
cout << "Czas wykonania algorytmu [s]: " << clock.read() << endl; cout << "Czas wykonania algorytmu [s]: " << clock.read() << endl;