summaryrefslogtreecommitdiffstats
path: root/labb3/tsp
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-09-22 11:15:46 +0200
committerGustav Sörnäs <gustav@sornas.net>2020-09-22 11:16:45 +0200
commit648ae219f5499fcdda90f8335c783c25d35cc2b8 (patch)
treecc07525589712d3c3722e1ce8d123e0a20275fbf /labb3/tsp
parentc7c7cf71500ffaef9b42abc5c2980889b08a6220 (diff)
downloadtddd86-648ae219f5499fcdda90f8335c783c25d35cc2b8.tar.gz
Correct output for redovisning
Diffstat (limited to 'labb3/tsp')
-rw-r--r--labb3/tsp/src/tsp.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/labb3/tsp/src/tsp.cpp b/labb3/tsp/src/tsp.cpp
index 975e657..52e66bc 100644
--- a/labb3/tsp/src/tsp.cpp
+++ b/labb3/tsp/src/tsp.cpp
@@ -19,7 +19,7 @@ int main(int argc, char *argv[]) {
QApplication a(argc, argv);
// MY ADDITION
- cout << "file: ";
+ cout << "file (empty for tsp10.txt): ";
string filename;
getline(cin, filename);
if (filename == "") {
@@ -52,12 +52,12 @@ int main(int argc, char *argv[]) {
while (input >> x >> y) {
Point p(x, y);
tour.insertSmallest(p);
- // uncomment the 4 lines below to animate
- tour.draw(scene);
- std::chrono::milliseconds dura(50);
- std::this_thread::sleep_for(dura);
- a.processEvents();
- scene->clear();
+ // uncomment the -4- 5 lines below to animate
+ //tour.draw(scene);
+ //std::chrono::milliseconds dura(50);
+ //std::this_thread::sleep_for(dura);
+ //a.processEvents();
+ //scene->clear();
}
input.close();
@@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
cout << "Tour distance: " << std::fixed << std::setprecision(4)
<< std::showpoint << tour.distance() << endl;
cout << "Number of points: " << tour.size() << endl;
- //tour.show();
+ tour.show();
// draw tour
tour.draw(scene);