diff --git a/Graph.cpp b/Graph.cpp index 517242c..eb1d175 100755 --- a/Graph.cpp +++ b/Graph.cpp @@ -624,17 +624,17 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps, } // Weryfikacja listy tabu... - // ...aktualizacja kadencji na liscie tabu - for(int i = 0; i < tabuArray.size(); i++) - { + int tabuPos = 0; + while(tabuPos < tabuArray.size()) + { + // ...aktualizacja kadencji na liscie tabu tabuArray.at(i).at(0)--; - } - - //...usuniecie zerowych kadencji - for(int i = 0; i < tabuArray.size(); i++) - { + + //...usuniecie zerowych kadencji if(tabuArray.at(i).at(0) == 0) tabuArray.erase(tabuArray.begin() + i); + else + tabuPos++; } // ...dopisanie ostatniego ruchu do listy tabu diff --git a/pea2plus.cpp b/pea2plus.cpp index 3fd80bf..94f91e0 100755 --- a/pea2plus.cpp +++ b/pea2plus.cpp @@ -204,7 +204,7 @@ void parseTSPLIB_EUC_2D(const char *filename, Graph **graph) void banner() { - cout << "PEA Projekt 2 Plus v2.0" << endl; + cout << "PEA Projekt 2 Plus v2.0.1" << endl; cout << "Jan Potocki 2017-2019" << endl; cout << "(beerware)" << endl; }