summaryrefslogtreecommitdiffstats
path: root/labb3/tsp/src/tsp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'labb3/tsp/src/tsp.cpp')
-rw-r--r--labb3/tsp/src/tsp.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/labb3/tsp/src/tsp.cpp b/labb3/tsp/src/tsp.cpp
index 566bf7c..57de067 100644
--- a/labb3/tsp/src/tsp.cpp
+++ b/labb3/tsp/src/tsp.cpp
@@ -18,7 +18,16 @@
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
- string filename = "tsp10.txt";
+ // MY ADDITION
+ cout << "file: ";
+ string filename;
+ getline(cin, filename);
+ if (filename == "") {
+ filename = "tsp10.txt";
+ }
+ // END OF ADDITION
+
+ //string filename = "tsp100.txt";
ifstream input;
input.open(filename);
@@ -42,12 +51,12 @@ int main(int argc, char *argv[]) {
double y;
while (input >> x >> y) {
Point p(x, y);
- tour.insertNearest(p);
- //uncomment the 4 lines below to animate
- //tour.draw(scene);
- //std::chrono::milliseconds dura(50);
- //std::this_thread::sleep_for(dura);
- //a.processEvents();
+ 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();
}
input.close();